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.

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

AI Builder AMA June 7th carousel (up on May 25th, take down June 8th) (1).png

'Ask Microsoft Anything' about AI Builder!

The AI Builder team invite you to ask questions and provide helpful answers at our next AMA.

Users online (1,377)