This week I needed to use the List Records function, and I realized that I had no idea how to use the filters. Thank you Jonas Rapp for creating the FetchXML Builder!! The function “Flow List parameters” saved my day:)
Let’s begin with the simple filters where I get a contact with the last name of Sandsør
Test your search result with the Execute button so see that anything is actually returned. Then open the Flow List Parameters
The tool converts the Fetch XML, and magically gives the correct filter to add in our FLOW query. It can’t get much simpler than that!!
Lookups act a little bit different with the syntax, as lookups always to. This got me quite confused before finding this tool, because I was not getting match to my result.
I am searching for contacts with a given GUID. In my case I didn’t know what the GUID was, so I randomly generated a GUID for the formula. In FLOW I substituted the GUID part of query with a dynamic variable.
Filter Query with lookups, you need to add “_” as seen above. When working with lookup you won’t get at match without the “_LookupField_Value”.
Filter linked entity
The last filter is a little more complex, and might not get used due to some limitations of Odata (Must match on unique ID for related).
In this scenario I wanted to locate all contacts with last name “Sandsør” where the regarding accountID = GUID.
Choose the main entity on top, and add “link-entity”
Make sure you have the correct relationship here. Some Lookups support more than one entity, and therefore you make sure you have the correct one.
Again we find the magic with the “Flow List Parameters“.
In this scenario we also get Expand Query result that we need to copy/paste.
Apply to Each
Once you have figured out what filter to use, you can select the “Apply to Each” function, and add custom logic in here.
7 thoughts on “CDS / Dataverse List Records Filter Query using Flow”
Thanks a lot for the post .. you saved my time a lot 🙂
Reblogged this on Nishant Rana’s Weblog.
Thanks Thomas for this wonderful article.
Thank you so much 🙂
Thank you! Quick question, how can you filter based on a choice field?
You should be able to filter on all filters that the FetchXML builder will allow you to add in the query.