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

Skip if output is null

Hi,

 

I'm wondering if someone is able to help if at all possible - I've adapted the daily RSS digest news template (https://emea.flow.microsoft.com/en-us/galleries/public/templates/f1af48a4661342b686ff2b649ada7780/ge...) slightly and have amended it to include a couple other RSS feeds that I'm interested in receiving news updates from and generating one larger email, rather than 3 or 4 different emails. 

 

However, it appears that if there is no news from one of the sites for the past 2 days, then the whole flow will fail because of that, even if the other 2 have content. 

 

Is there a way that I can skip or configure it to just post the outputs that contain data and prevent it from failing? Any help would be appreciated! Some shots of the power automate below:

Snip1.png

Snip2.PNG

6 REPLIES 6
efialttes
Super User III
Super User III

Hi!

I assume the 'Condition' rules you added are evaluating length of the three different 'Filter array' outputs, right?

If so, did you consider replacing 'And' operator and using 'Or' instead? I mean, your current Condition will take the true branch only if all three 'Filter Array' outputs are greater than zero. If you use 'Or' instead, your Condition will take the true branch if any of the three 'Filter Array' outputs is greater than 0.

 

Flow_AndVSOr.png

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Hi, Apologies for the bad screenshot, I do actually have it already set to 'Or'. The screenshot I posted was from trying something different. 

 

I've attached a snip of how it composes the email below, as well as the step where it appears to be 'failing':

 snip4.png

Snip3.png

Hi again

Not 100% sure, since I cannot see join() expression details on your new screenshot, but it looks like you are trying to apply it to your filter array outputs, right? Assuming output array can sometimes be empty, I would try with a conditional expression:

 

if(greater(length(<yourFilterArrayOutputHere>),0),'<yourCurrentJoinExpressionHere>,'')

 

...so just replace <yourFilterArrayOutputHere> and <yourCurrentJoinExpressionHere>

 

Not with my laptop, unable to test. Anyway, please let us know your progress

Thanx!

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



v-litu-msft
Community Support
Community Support

Hi @louielt,

 

You could use if() function to determine the output of the json whether contains value, if it is empty or length is 0, return a null value; or return itself, for example:

if(equals(length(variables('news')),0),'',variables('news'))

Annotation 2020-07-08 132539.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your response - I'll look to try your steps mentioned and will revert back. Just for info, here's the join expression pulling all of the links together for the compose

 

snip5.PNG

 

Thanks for your help! Louie

Hi @efialttes - I've just been trying to get this working however I seem to be getting the expression wrong. 

 

Please see the expression details below:

 

Step 1 -

 

This checks to see whether there are outputs in the past 2 daysThis checks to see whether there are outputs in the past 2 days

 

Step 2 - 

Composes the links in a legible formatComposes the links in a legible format

 

Step 3 -

 

 Joins the previous step aboveJoins the previous step above

 

Is it the 3rd step where I need to try your if(greater(length(<yourFilterArrayOutputHere>),0),'<yourCurrentJoinExpressionHere>,'') expression? 

 

Thanks, Louie

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,347)