Filter by tags in a list

Options
I have setup a database with multiple tags in a list (guidedmicrofilter_id):
[Screenshot 2022-01-24 at 23.20.29.png]I want to fetch guided_exercises if they include a tag. I have tried with a filter like this:
[Screenshot 2022-01-24 at 23.20.18.png]But this then gives me this error:
[Screenshot 2022-01-24 at 23.20.05.png]Any help would be much appreciated!

Comments

  • Facundo Lucci
    Options
    Hey Steve,
    I think you want to set that query to “contains” instead of “=“. And make sure the right side is an array. You can create a array variable and push guidedmacrofilter_id into it. Hope that works!
  • Steve Wright-2225084
    Options
     Thanks Facundo, I've changed the query to contains but I don't understand how to push the guidedmacofilter_id into that array in the 'configure search' panel:
    [Screenshot 2022-01-25 at 00.03.54.png]
  • Facundo Lucci
    Options

    I got you no worries. You’ll want to add a create variable function before your query all records function. and then use that variable in the search query on right hand side.
    [371E49A6-BD8E-4F49-A11B-4321F78B9101]
  • Steve Wright-2225084
    Options
     Getting closer:

    I now have that new create variable function setup:

    [Screenshot 2022-01-25 at 00.18.41.png]

    But getting this error:
    [Screenshot 2022-01-25 at 00.18.33.png]

    I think the issue is how I'm using the variable in this configure search? I don't think it's working as an array:

    [Screenshot 2022-01-25 at 00.18.49.png]
  • Facundo Lucci
    Options

    :) almost. Look at my screenshot once more. On the create var function, I have the value set to array []. You have it set to the input.
  • Facundo Lucci
    Options
    :) almost. Check my screenshot once more. You have the value for the variable set to your function input. It should be just an array.
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    If you are wanting to see if a single value is IN an array then you can use the IN operator and don't need to put the value in an array. 

    IN is for comparison of a single value to an array
    CONTAINS is for comparison of an array to an array
  • Facundo Lucci
    Options

    thanks for heads up :)
  • Steve Wright-2225084
    Options
     Thanks Facundo, I got this working and now have gone back to it and suddenly it's running but returning 0 regardless of the id I input:
    [Screenshot 2022-01-27 at 14.38.36.png][Screenshot 2022-01-27 at 14.38.48.png][Screenshot 2022-01-27 at 14.38.58.png][Screenshot 2022-01-27 at 14.39.07.png]

    Any idea why?
  • Facundo Lucci
    Options



    I’m not sure. Have you changed any of the output settings on that query all records function maybe?

    Also, If you know you are only going to be searching with one ID you can try using IN as suggested in Michael’s reply. You won’t need to use that create array variable function. You can use put the input directly on the query instead of var_1. But I was able to make both methods return the same records on my end.
  • Steve Wright-2225084
    Options
     Nice one. Using "in" has fixed it :) Thanks my friend