cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

- Without the condition the Flow creates a SharePoint item from Microsoft Forms. So this part works good.

- The condition; id-test(Microsoft ID) is the same as Id-test(SharePoint item) does't work, see condition.

Someone got a idea to let it work?

forms1.PNGFlow2.PNG

3 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

Hi @ahmadbutt,

 

The issue may be caused by the column name "Id-test" is not valid, you should encode the "-" character when you use the ODATA filter query, for example:

Annotation 2019-12-12 100036.png

 

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.

View solution in original post

Highlighted
Super User II
Super User II

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

@ahmadbutt 

The 'Get Items' action could return multiple items... if it did your 'Update Item' would run multiple times.

I was asking you to check the 'Body' value of the 'Get Items' action to verify the number of items returned... you could also page through the... but to do is the simple way just check how many times the 'Apply to each' loop has run.

A.png

 

View solution in original post

Highlighted
Helper IV
Helper IV

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

@Jay-Encodian @v-litu-msft @manuelstgomes The problem was that I had 2 flows open with the same Flow. I had copied it.. So the flows ran 2 times. I turned 1 Flow off and that was the problem. Sorry for this.... and thanks for the help again.

View solution in original post

37 REPLIES 37
Highlighted
Super User II
Super User II

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

Hi @ahmadbutt 

 

The names look the same and from the same source, so I suspect, you're comparing a value with itself :).

 

If you're fetching the first item from the Form and the second from the trigger body (also the Form) it will always fail since it's the same value.

 

Makes sense?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Highlighted
Helper IV
Helper IV

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

@manuelstgomes Oh.. how do I get the id-test from the SharePoint list item?

Highlighted
Super User II
Super User II

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

HI @ahmadbutt 

 

You need to query SharePoint to do that. Just do the following:

small-Screenshot_2019-12-09_at_10_13_38.jpg

 

The formula in the condition is the following:

length(body('Get_items'))

 

Basically we're checking if values are returned. If one is returned then the value already exists. If not you can create it.

 

Makes sense?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

 

Highlighted
Helper IV
Helper IV

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

@manuelstgomes The yellow marked is different with yours? I get a error when I run with this...

 1e.PNG

Highlighted
Super User II
Super User II

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

Hi @ahmadbutt 

 

It's normal. I needed to use another trigger to get the screenshots because I don't have a form ready, but it should work.

 

Can you please show me the error?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Highlighted
Helper IV
Helper IV

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

@manuelstgomes this is the error:

1e.PNG

Highlighted
Super User II
Super User II

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

HI @ahmadbutt 

 

Is the datatype in SharePoint of the "Id-test" a number or a text?

 

If it's a text you need to include an ' between the value.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Highlighted
Helper IV
Helper IV

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

@manuelstgomes Can you maybe send a screenshot so I can understand it better? It's text. yes.

Highlighted
Super User II
Super User II

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

HI @ahmadbutt 

 

Here's the formula:

 

Id-test eq '@{body('Get_response_details')?['Id-test']}'

 

Makes sense?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

 

Highlighted
Helper IV
Helper IV

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

@manuelstgomes I get the same error again..?

- I also tried with other id numbers like 17...

  1. 1e.PNG
Highlighted
Super User II
Super User II

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

Hi @ahmadbutt 

 

Hum.. We'll figure this out don't worry.

 

Can you share the "Get Items" action including the formula?

 

Just for me to try to understand what may be wrong.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Highlighted
Helper IV
Helper IV

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

@manuelstgomes 

Formula: Id-test eq '@{body('Get_response_details')?['rdc3f629f323645aab075cc1e49671c26']}', COPY en paste <--,

Same as picture so: Id-test eq 'Id-test'

1e.PNG

--2e.PNG

Highlighted
Helper IV
Helper IV

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

@manuelstgomes , I just copied the formula in the text field. Do I need to do it with the dynamic content or Expression? This is not possible to do..

1e.PNG

Highlighted
Super User II
Super User II

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

HI@ahmadbutt 

 

Just copy it directly into the Filter query's text box. It should work it's magic there and you don't need to worry 🙂

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Highlighted
Helper IV
Helper IV

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

@manuelstgomes I did but I get the same error as in message 11... error 400..

Highlighted
Community Support
Community Support

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

Hi @ahmadbutt,

 

The issue may be caused by the column name "Id-test" is not valid, you should encode the "-" character when you use the ODATA filter query, for example:

Annotation 2019-12-12 100036.png

 

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.

View solution in original post

Highlighted
Helper IV
Helper IV

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

@v-litu-msft That works now but the condition doesn't. See error:

I also tried with array(0), string(0) and just 0.. 

1e.PNG

--

2e.PNG

Highlighted
Community Support
Community Support

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

Hi @ahmadbutt,

 

Please use the length(body('Get_items')?['value']) on the left side of condition, number 0 on the right side:Annotation 2019-12-12 174323.png

 

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.

Highlighted
Helper IV
Helper IV

Re: Condition is not working, it is always false... (Microsoft Forms to SharePoint item)

@v-litu-msft The False condition works now with creating a item, but the True condition doesn't work. I get this error:1e.PNG

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (8,315)