Filtering array content using contains with a variable value #5416
Answered
by
jasonvarga
donguinesjay
asked this question in
Q&A
-
Hi is there a way to make a condition to check if an array contains a specific variable value? eg. I want to check if the value of title variable is inside the arr_data. |
Beta Was this translation helpful? Give feedback.
Answered by
jasonvarga
Mar 7, 2022
Replies: 2 comments 4 replies
-
Did you try: {{ if arr_data | in_array:title }} I believe it checks whether a variable with that name exists when you pass a string. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Try |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
donguinesjay
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try
{{ if arr | contains:title }}