cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dougydoe
Frequent Visitor

Filtering a Single Item JSON Array

Hello Community,

 

I'm hoping someone can point me in the right direction on something I want my flow to achieve

 

At this point in my flow, some of the variables in the JSON (please see image below) will contain data and some will not. 

 

How do I filter out those that contain data? I'll the use HTML Tables Action to send the filtered items to recipients via email, which I think I have a handle on.

 

I've tried using the SELECT and FILTER ARRAY Actions but struggling to find a way round since it's only a Single Item Array. I just keep getting everything back. 

 

Flow Snippet.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
dougydoe
Frequent Visitor

Hi @v-bofeng-msft, Thank you for your response. Your answer confirmed my suspicions that there might not be an OTB Action to do what I was looking for. I really appreciate your effort in putting together this custom expression which looks like the way forward. I'll implement this as it looks like it will work for me.

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @dougydoe :

I am afraid that there is no Action or Function that can directly filter the elements in an Object.

I suggest you use equals(value,null) to determine whether each element is empty one by one.I've made a test for your reference:

vbofengmsft_0-1634869293769.png

The Result

vbofengmsft_1-1634869307172.png

 

 

Best Regards,

Bof

dougydoe
Frequent Visitor

Hi @v-bofeng-msft, Thank you for your response. Your answer confirmed my suspicions that there might not be an OTB Action to do what I was looking for. I really appreciate your effort in putting together this custom expression which looks like the way forward. I'll implement this as it looks like it will work for me.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,168)