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

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

@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 III
Super User III

@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

@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

@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

@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 responseget items responseget items codeget items codeemail nameemail name the get items

 

 

@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

@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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (89,848)