Hi
I need help in using filter query in get items from compose outputs.
Below is the output from compose
Please help how I can compare and get items from the list if it matches.
Solved! Go to Solution.
Hi @ganeshn07
You can use or to connect two conditions in the filter query (note the single quotes).
Title eq 'A' or Title eq 'B'
Best Regards,
Levi
Here's an example that should work with as many items in your array as you want. Effectively, it builds up the filter for each item separated by an or clause.
Full flow below. I'll go into each of the actions.
Compose contains your array of items.
Select will build up an array of individual conditions. The expression used here is:
concat('Title eq ''', item(), '''')
If I ran my flow now, I'd get the following output from my Select:
[
"Title eq 'First'",
"Title eq 'Second'"
]
Join will join each of the items above, separated by ' or '.
The output from my Join would be:
Title eq 'First' or Title eq 'Second'
Get items can then use the output from the Join as the Filter Query we need.
If you just want the First one, you can use the expression "first()" - in between the brackets you put the output from your Compose.
If you want to do it for each item in your Compose's output, you can use an "Apply to Each" and then point the Filter Query at the "Current Item" (it'll be at the very bottom of your dynamic content).
Like this:
I answer questions on the forum for 2-3 hours every Thursday!
Hi @ganeshn07
You can use or to connect two conditions in the filter query (note the single quotes).
Title eq 'A' or Title eq 'B'
Best Regards,
Levi
Here's an example that should work with as many items in your array as you want. Effectively, it builds up the filter for each item separated by an or clause.
Full flow below. I'll go into each of the actions.
Compose contains your array of items.
Select will build up an array of individual conditions. The expression used here is:
concat('Title eq ''', item(), '''')
If I ran my flow now, I'd get the following output from my Select:
[
"Title eq 'First'",
"Title eq 'Second'"
]
Join will join each of the items above, separated by ' or '.
The output from my Join would be:
Title eq 'First' or Title eq 'Second'
Get items can then use the output from the Join as the Filter Query we need.
User | Count |
---|---|
93 | |
39 | |
24 | |
21 | |
16 |
User | Count |
---|---|
129 | |
49 | |
48 | |
31 | |
25 |