cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
tonydavies
Level: Power Up

condition not working

Hi, I am having an issue with a conditon

Here is the problem I am trying to solve. When an email comes in, I want to post some of the content to sharepoint

 

I use these steps to get email from HTML to text and get the text in an array so I can iterate through the lines looking for a trigger phrase. When I find the trigger phrase I want to put all subsequent lines into a variable and then post the variable contents to a SP list.

 

flow1.png

 

The trigger phase is New Feature and you can see exists in my string array. 

 

Here is my condition, i'm checking the output of the split in the compose step for the trigger phrase. I have set up a varible with the trigger phrase, but I get the same result if I use a literal

flow2.png

 

Here is the run output telling me the trigger condition is not met. It's iteresting to see that "Next Failed" message in the apply to each. That might me telling me the flow failed to read the array output from the compose step.

flow3.png

 

Note, this is a simplified version of the condition. In the real flow I set a CanOutPut flag when the condition is true and that flag controls the output to the variable.

Anybody have any idea what is going on here?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: condition not working

Hi @tonydavies 

 

try following condition

expression

startsWith(item(),'New Feature')
 
condition expression above eqquals to true (true is the expression true)
Capture.PNG
 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

9 REPLIES 9
Super User
Super User

Re: condition not working

Hi @tonydavies 

 

try following condition

expression

startsWith(item(),'New Feature')
 
condition expression above eqquals to true (true is the expression true)
Capture.PNG
 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

tonydavies
Level: Power Up

Re: condition not working

@RezaDorrani   No, doesn't work.  I used 'New' and not 'New Feature',  but that shouldn't matter.  I  still think flow is now managing to evauate the array element by element.

 

tony

flow6.pngflow5.png

Super User
Super User

Re: condition not working

Hi @tonydavies 

 

true with a small letter t

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

tonydavies
Level: Power Up

Re: condition not working

Hi @RezaDorrani  , no, still doesn't evaluate. I tried using the variable instead of the literal as well.  I wonder is the " at the start of each element is causing an issue?

 

flow7.png

Super User
Super User

Re: condition not working

Hi @tonydavies 

 

Try adding a compose statement prior to the condition

 

in that compose use expression

item() and then check to see if you get "

If you do then modift your condition to say start with ---   "New Feature

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

tonydavies
Level: Power Up

Re: condition not working

@RezaDorrani  There is definately a " in the output.   Both startsWith(item(),"New) and

startsWith(item(),'"New') fail to tigger.  Interestingly, IndexOf(item(),'New')<> -1 also fails to trigger the condition, but IndexOf(item(),'New')<> fx(false) does trigger the condition, but tiggers for every element. I don't know what if -1 equates to false in flow
 
I'll try a simpler flow to see if I can get the condition to trigger
 
Tony
Super User
Super User

Re: condition not working

Hi @tonydavies 

 

how are you splitting html to text to array on Compose action?

tonydavies
Level: Power Up

Re: condition not working

@RezaDorrani  Yes, that compose does a split bt carriage return

 

The last bit of my flow sends an email of the cleaned/parsed data and I have emails where New is being picked out. I did bother checking for outputemails as the flow results show no trigger action. I just thought is that showing the action for the last element in the array?  That would be consistant with what I see in my email, in which case , one of the things I've tried worked. Let me try then all again and see what goes on

 

Tony

tonydavies
Level: Power Up

Re: condition not working

@RezaDorrani  This works 

flow9.png

 

So i would say using fx(Item()) instead of the output from the compose is what I needed to do. You had the answer all along. Thanks for helping me.

 

Tony

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 76 members 3,721 guests
Recent signins:
Please welcome our newest community members: