Odata Filters & nested objects with Microsoft Flow
Last week, Kent Weare from the Microsoft Flow team illustrated the usage of the very convenient and elegant oData Filter in Microsoft Flow. Read his blog post to have a good background on OData and Flow.
As a follow-up of this blog post I would like to get a little bit deeper with a more specific example that I had to solve last year : filtering on a nested field like the e-mail address of a SharePoint Person column.
If you have the following SharePoint list with 2 columns of type Person or Group : Managee and Manager
…and your flow needs to retrieve the Manager of ‘serge luca’ (sergeluca@redwoodsl.onmicrosoft.com).
The oData filter query will be the following :
How did I know this ?
Use the Get items action in your flow without using any filter, debug it and check the output JSON : we get something like this :
so Managee/Email is the good filter syntax : indeed Email is the nested field and its path is Managee/Email.
…and yes the Eq operator is very case sensitive : Managee/email won’t work ...
Comments
-
Odata Filters & nested objects with Microsoft Flow
so Managee/Email is the good filter syntax : indeed Email is the nested field and its path is Managee/Email.
…and yes the Eq operator is very case sensitive : Managee/email won’t work ...
Should be Managee/EMail because Managee/Email doesn't work. Use a capital M when searching an emailaddress in Person fields. Your screenshot was correct but the text below wasnt.
-
Odata Filters & nested objects with Microsoft Flow
Like it mentioned in the update EMail (Case sensitive) works. To filter by DisplayName it doesn't work either. Not sure where we can get this schema name similar to EMail.
-
Odata Filters & nested objects with Microsoft Flow
Wow... so in JSON summary one can find "Email" but you still need to put "EMail" in the query. So logical... thanks Microsoft
-
Odata Filters & nested objects with Microsoft Flow
I'm having a different issue with this.
When I use the filter, I'm able to get the item "Managee" which matches the criteria, but I'm not able to get the info from the "Manager" column beside it. What was the next step?
(The "Manager" email / department / etc. options all vanish from the dynamic content options for following steps).
-
Odata Filters & nested objects with Microsoft Flow
Thanks for your post, this is something that I've been trying to work out for ages.
However, I have tried to replicate this, but everytime the Flow runs I get a "BadGateway" error:
The Body of the error is:
My "Cascade Child 1" list has a (single value) Person column in it called "Person".
Can you see what I'm doing wrong?
Thanks for any assistance,
Ian
*** Update ***
I have worked this out myself, it was the case of "Email" causing the issue. In your notes it mentions "EMail" and "Email", and in the screenshot of JSON output it shows as "Email". I thought the case in the JSON output would have been correct and your references to "EMail" in your notes maybe a typo. However, changing my filter query to "EMail" worked!
*This post is locked for comments