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
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.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

AI Builder AMA June 7th carousel (up on May 25th, take down June 8th) (1).png

'Ask Microsoft Anything' about AI Builder!

The AI Builder team invite you to ask questions and provide helpful answers at our next AMA.

Users online (1,576)