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

Equal to Condition never evaluates True

I have a Master Location List (Table A) on a parent SharePoint site and a partial copy of this list on a subsite (Table B).  I want to keep the two in synch with Flow.  (Side note: I was using a site lookup column on the parent site, but I have had difficulty accessing site column information with Flows triggered by the subsite.) 

 

I have made a flow that runs on the Table A when an item is create or modified.   Right now, I'm trying to create the "what to do if the item is modified" branch of the flow, hence Condition 1.  My flow works fine until you get to Condition 2 - which never finds a match so the update item is never run.  I know Table B has a matching record. (Another flow actually created the matching record in Table B from Table A; I used excel to check the matches on the Service Location Field between the two lists.)

basic_flow_image.PNG

I noticed in the run details is that the condition only seems to get checked for 100 "Get items' when their are 149 records in the list.  I've set the view to show 200 items, I've verifyied that field type (single line text) and size are the same.  I've sorted the view differntly.  Do you have any ideas as to why the condition might always be false?

run_results image.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Memorable Member
Memorable Member

Re: Equal to Condition never evaluates True

Hi ,

If my understanding is correct, you want to update the item on Table B based on the matching item being modified on Table A. One approach I'd take is to change the Get Items action for Table B to include a Filter Query to just retrieve the item that matches the item in Table A. For example, let's say your Service Location field is unique. You can build your Filter Query as Service Location eq 'Service Location'. The Service Location wrapped in single quotes comes from your trigger. Then in your second condition, you can build an expression on the left field similar to this: length(body('Get_items_2')) leave is equal by default and then on the right field enter the number 1. If a matching item is found, then your condition will return true and the Update item action will proceed. And if not, then nothing happens.
I hope this points you on the right direction. By the way, do a search on the forums for this: check if SharePoint list item exists. There are a few posts about that, and they should help you on the second part of your Flow. Please, do not hesitate to reach out if you have any questions.

Update: here's a link to a forum post that covers what I tried to explain above. I hope it helps:
https://powerusers.microsoft.com/t5/Building-Flows/How-to-check-if-an-item-exists-on-a-SharePoint-li...

Regards,
Fausto Capellán, Jr
Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

3 REPLIES 3
Highlighted
Memorable Member
Memorable Member

Re: Equal to Condition never evaluates True

Hi ,

If my understanding is correct, you want to update the item on Table B based on the matching item being modified on Table A. One approach I'd take is to change the Get Items action for Table B to include a Filter Query to just retrieve the item that matches the item in Table A. For example, let's say your Service Location field is unique. You can build your Filter Query as Service Location eq 'Service Location'. The Service Location wrapped in single quotes comes from your trigger. Then in your second condition, you can build an expression on the left field similar to this: length(body('Get_items_2')) leave is equal by default and then on the right field enter the number 1. If a matching item is found, then your condition will return true and the Update item action will proceed. And if not, then nothing happens.
I hope this points you on the right direction. By the way, do a search on the forums for this: check if SharePoint list item exists. There are a few posts about that, and they should help you on the second part of your Flow. Please, do not hesitate to reach out if you have any questions.

Update: here's a link to a forum post that covers what I tried to explain above. I hope it helps:
https://powerusers.microsoft.com/t5/Building-Flows/How-to-check-if-an-item-exists-on-a-SharePoint-li...

Regards,
Fausto Capellán, Jr
Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

Highlighted
Frequent Visitor

Re: Equal to Condition never evaluates True

Thanks Fausto.  I this got me in the right direction.  I like this better, as it doesn't spend time looping through the destination table.   I'm having trouble getting the Filter Query to work.  I get the message - The expression "Service Location Code eq 'AA_AA_AA'" is not valid.  I first tried putting the single quotes in Filter Query (like image) and leaving them out with the same error.  I would have guessed that the column name isn't the problem because I wan't not getting that error anymore, but it is... since I have spaces in the name.  Using the output from the unfiltered get items you find the below.  Once you change the left half of the equation to the below, it works!

Service_x0020_Location_x0020_Cod

filter_query.PNG

 

I have a flow that works when an item is created that adds it to the other list if it doesn't exist; I'll merge the two together when I get this one working!  I'm sure that will be another challenge! Thanks for your time!

Highlighted
Memorable Member
Memorable Member

Re: Equal to Condition never evaluates True

Hi @ChristyQV

 

I'm glad my suggestions got you in the right direction to achieve what you need with Flow. Please do not hesitate to reach out if you need any assistance in the future.

 

Regards,

Fausto Capellan, Jr

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,572)