cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
RossKnorr
Level: Powered On

Help using a condition to advance a flow only if a field in a Sharepoint item matches a field in a different Sharepoint list.

Hi,

 

I think what I'm trying to do will be pretty easy to somebody out there, but I'm relatively new to Flow! I have two data sources:

 

- "CCC User List": A Sharepoint list that includes the information (location and name) for a list of users of a PowerApp that records instructional observations.

- "CCC App Data": A Sharepoint list where the information (teacher observed, ratings, etc.) entered in the PowerApp is stored.

 

When a person using the app (the observer) submits data, it records their name, the teacher's name, the teacher's location, and some other things irrelevant to this. I want a report to be sent by email only if the observer (the person in the CCC User List) has a location in the CCC User List that matches the location of the teacher (who is recorded in the CCC App Data list).

 

Here's what I've done so far:

 

- Trigger: When an item is created in the "CCC App Data" list.

- Action: Get items from "CCC User List".

- Condition: IF... and this is where I get lost.

 

I know how to make the email report and pull in the fields for the report - I just need help with the condition.

 

Thanks in advance for any help!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Help using a condition to advance a flow only if a field in a Sharepoint item matches a field in a different Sharepoint list.

Hi @RossKnorr 

 

Believe your first step is the flow trigger 'SharePoint - When an item created'
Here you set your SharePoint address and List Name as 'CCC App Data'

 

Next flow step add flow action 'SharePoint - Get items'
Set the site address
List Name as 'CCC User List'
Filter Query as following:
Location eq 'Location' and FullName eq 'Observer Name'

For the above 'Location' value > Map the location field value of 'CCC App Data' from the first step
'Observer Name' value > Map the location field value of 'CCC App Data' from the first step

 

Next add a flow action Compose to check the length of the get items
"@length(body('Get_items')?['value'])"

 

Next step you can add the flow action IF condition against the compose output value is > 0 then do the email report.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



View solution in original post

6 REPLIES 6
Super User
Super User

Re: Help using a condition to advance a flow only if a field in a Sharepoint item matches a field in a different Sharepoint list.

Hi @RossKnorr 

 

"CCC User List" & "CCC App Data" what fields you are comparing with. 

You mentioned "only if the observer (the person in the CCC User List) has a location in the CCC User List that matches the location of the teacher (who is recorded in the CCC App Data list)."

 

You can filter the data in SharePoint using ODATA filter.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



Community Support Team
Community Support Team

Re: Help using a condition to advance a flow only if a field in a Sharepoint item matches a field in a different Sharepoint list.

Hi @RossKnorr ,

 

As @abm asked, what fields re you want to compare from the "CCC User List" & "CCC App Data"? 

Could you please share the full fields in the "CCC User List" & "CCC App Data"?

Do you want to compare the teacher's location field from the created item in "CCC App Data" with the location field from the item (which has the same Name in the item) in"CCC User List"?

If yes, please let me know and I would offer you the workaround.

 

Please share more details so we could better undertand your issue and provide a proper workaround for you.

 

Best regards,

Alice       

 

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

RossKnorr
Level: Powered On

Re: Help using a condition to advance a flow only if a field in a Sharepoint item matches a field in a different Sharepoint list.

Hi Alice,

 

Thanks for your help. I think what you're saying is correct when you ask:

 

"Do you want to compare the teacher's location field from the created item in "CCC App Data" with the location field from the item (which has the same Name in the item) in"CCC User List"?"

 

Here are the fields for CCC App Data:

Title

Observer Name

Teacher Name

Observer Email

Teacher Email

Location

Comment

 

Here are the fields for CCC User List:

Location

Full Name

Email

 

I want to match the location and observer name in the new item for "CCC App Data" with the location and full name in the "CCC User List". Only if these match do I want the flow to continue.

Super User
Super User

Re: Help using a condition to advance a flow only if a field in a Sharepoint item matches a field in a different Sharepoint list.

Hi @RossKnorr 

 

Believe your first step is the flow trigger 'SharePoint - When an item created'
Here you set your SharePoint address and List Name as 'CCC App Data'

 

Next flow step add flow action 'SharePoint - Get items'
Set the site address
List Name as 'CCC User List'
Filter Query as following:
Location eq 'Location' and FullName eq 'Observer Name'

For the above 'Location' value > Map the location field value of 'CCC App Data' from the first step
'Observer Name' value > Map the location field value of 'CCC App Data' from the first step

 

Next add a flow action Compose to check the length of the get items
"@length(body('Get_items')?['value'])"

 

Next step you can add the flow action IF condition against the compose output value is > 0 then do the email report.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



View solution in original post

jwhite
Level 8

Re: Help using a condition to advance a flow only if a field in a Sharepoint item matches a field in a different Sharepoint list.

Hi @RossKnorr,

As mentioned previously you could use an ODATA query to match the teacher location to the observation name and then check if the location in CCC App Data matches the Observer Location:

UserMatchFilter.png

Here we use the filter query FullName eq '[Observer Name]' with [Observer Name] coming from our CCC App Data item being created.

We then have the condition in an apply to each with the value from "Get Teacher Details":

UserMatchCondition.png

The two conditions we are checking are 1: the location from CCC App Data and 2: the location from observer details.

Let me know if this helps!

Super User
Super User

Re: Help using a condition to advance a flow only if a field in a Sharepoint item matches a field in a different Sharepoint list.

Hi @RossKnorr 

 

Like I mentioned earlier the ODATA query can filter with multiple conditions. All you need to add is include the 'and' operator to check the location as well.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,394)