cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

comparing lists

hi all! 

I have been stuck in creating a flow and have tried various things. I need to make a flow where i am able to have the user input their ID number and have that compared back to a previous list that has all of the acceptable ID numbers. If the ID number inputted doesn't match an acceptable one, send an email.

 

I have my trigger set to be creating an item. that new item has an input of an ID number. I need to take that inputted ID number and see if it matches one of the accepted ID numbers in a separate sharepoint list. If the inputted ID does not match any accepted value then send an email

 thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
eric-cheng
Solution Sage
Solution Sage

Hi @Anonymous ,

 

Based on the sound of things, you need to use the Get Items action and the length() expresion to see if any items were returned.

 

Check out the flow below.

 

1. Trigger when item is created in List1

2. Get Items to search List2 for approved IDs.  Note the odata filter Title eq 'xxxx'.  This will search for any items where the Title column equals the value of Col1 (your ID field).  Adjust as required.

3. Use length() to determine how many items were found.  If it is 0, no items were found.  Otherwise 1 or more were found. 

 

@length(outputs('Get_items')?['body/value'])

 

4. Condition to check if item was found

5. Send email if not found

 

Screenshot_20210905-233446_Chrome.jpg

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

2 REPLIES 2
eric-cheng
Solution Sage
Solution Sage

Hi @Anonymous ,

 

Based on the sound of things, you need to use the Get Items action and the length() expresion to see if any items were returned.

 

Check out the flow below.

 

1. Trigger when item is created in List1

2. Get Items to search List2 for approved IDs.  Note the odata filter Title eq 'xxxx'.  This will search for any items where the Title column equals the value of Col1 (your ID field).  Adjust as required.

3. Use length() to determine how many items were found.  If it is 0, no items were found.  Otherwise 1 or more were found. 

 

@length(outputs('Get_items')?['body/value'])

 

4. Condition to check if item was found

5. Send email if not found

 

Screenshot_20210905-233446_Chrome.jpg

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

RonanVico
Regular Visitor

I Think you are using the wrong approach  , microsoft lists can create an LookUp column who can limit IDs to just accept the right values, 

https://support.microsoft.com/en-us/office/create-list-relationships-by-using-unique-and-lookup-colu...



-----------------------------------
If i answered your question , please mark my post as solution.
if it helped u give a thumbs up


https://www.linkedin.com.br/in/ronan-vico/

https://www.youtube.comc/c/RonanVico




 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,321)