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

Looking for an exisitng entry in a sharepoint list

Hello

 

I have a teams form that collects user details including an email address. I need to check a sharepoint list to see if that email already exists, and from there take an action. I have read the help online and I am struggling to make it work.

 

Can any one help me.

 

Allan

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Looking for an exisitng entry in a sharepoint list

@Elohelae 

Try putting single quotes before and after the Email parameter in your query filter.   See my example as well as the screen shot below.

 

TeamFormFlo3.jpg

 

 

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

Scott

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Looking for an exisitng entry in a sharepoint list

@Elohelae 

I want to be sure that I understand your issue before I create a solution.  Are you saying that you are using Forms and exposing the Form inside of Teams?  Also, what action do you want to take if you find the email and what do you want to do if you don't?

 

 

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

Scott
Elohelae
Level: Powered On

Re: Looking for an exisitng entry in a sharepoint list

@ScottShearer 

 

Thank you for your reply.

 

I am exposing the form in MsTeams and I am able to retrieve data from the forms and I am able to create a new entry in my SharePoint list.

 

However, I am aware that those using the form may try to submit duplicate entries over time, therefore I want to check the Sharepoint list to make a choice to either update the existing entry or create a new entry with the correct data from the form.

 

My hope would be that I can check the list and if it comes up a duplicate then I can apply a condition statement.

 

I have tried web sources that try to use the @empty statement with filters in a get items box, however, my lack of programming skill is hampering my efforts there.

 

I appreciate any guidance I can receive with this.

 

Allan

Super User
Super User

Re: Looking for an exisitng entry in a sharepoint list

@Elohelae 

Please see my screen shots below.  In my SharePoint list I have a column called email.  In my Get items action I use a filter query so that only records with the email of the person who submitted the form will be returned.  If the number of records returned is zero, then I know that there is no entry in the list with that email address.

My expression for the condition can be found in the comments for the condition.

Note the single quotes around the parameter in the filter query.  Also note that the filter query uses a columns internal name which may not be the same as it's display name.  Please post here is you have any questions.

TeamFormFlo1.jpgTeamFormFlo2.jpg

 

 

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

Scott
Elohelae
Level: Powered On

Re: Looking for an exisitng entry in a sharepoint list

@ScottShearer 

 

Once again, thank you for this.

 

Here is a copy of the length code 

length(body('Get_items')?['value'])

 

It failed at the same spot I have failed previously which is the get items failing at the filter expression.

 

I look forward to your assistance

 

Allan

 

here is the result ofget items.JPGget items responseget items filter.JPGget items codecolumn setting.JPGemail name the get items

 

 
Super User
Super User

Re: Looking for an exisitng entry in a sharepoint list

@Elohelae 

Try putting single quotes before and after the Email parameter in your query filter.   See my example as well as the screen shot below.

 

TeamFormFlo3.jpg

 

 

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

Scott

View solution in original post

Elohelae
Level: Powered On

Re: Looking for an exisitng entry in a sharepoint list

@ScottShearer 

 

Thank you very much, that was it. All is working correctly. Thank you for your time, and I hope your day goes well.

 

Allan

Helpful resources

Announcements
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!

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 Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,219)