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

Using form response to update a SharePoint list?

I have a SharePoint list that can be updated using a form. One of the form fields is to enter in the primary key and then another field to update the SharePoint list. 

If there's a key match, then it should update the list. If there's not a key match, I want for an email to be sent to the form responder saying that the key they entered does not match anything on the SharePoint list. 

 

The filter query doesn't work the way I have it set up because it doesn't do anything if the query returns null. I've tried setting up the condition where if the query returns null it goes to If No, but maybe I messed up the syntax, that didn't seem to work either. 

Any help you can provide is appreciated! 

image.png

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @trk_0930 there are a couple of ways that you can test to see if it exists or not. I've done two videos on YouTube, the first uses Filter array, and the second uses the filter query. Have a quick look and see if they help you out:

 

Filter Array Method: https://youtu.be/YLqMiDubA7s

Filter Query Method: https://youtu.be/x6QcntAs2_0

 

I hope that helps

View solution in original post

4 REPLIES 4

Hey @trk_0930 

 

The flow looks right to me except where you are implementing the filter query and adding the condition as well. You just need one right? Can you run the flow with the filter query and check what is the list items that is returned? 

 

In this you can then have a condition to check the length of the returned list from Sharepoint and if that is 0, create a new item and if not then update the item. 

 

Hope this Helps!

 

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!

@yashag2255 

When I don't filter the query, it seems like the apply to each is testing the condition for each item in SharePoint.

For example, if I had four items in the SP list, and one matches from the form, then it'll update the item where the key matches but still send three emails saying how the title doesn't match. Do you know any way to get around that?

Hi @trk_0930 there are a couple of ways that you can test to see if it exists or not. I've done two videos on YouTube, the first uses Filter array, and the second uses the filter query. Have a quick look and see if they help you out:

 

Filter Array Method: https://youtu.be/YLqMiDubA7s

Filter Query Method: https://youtu.be/x6QcntAs2_0

 

I hope that helps

@MattWeston365 these solutions worked perfectly, it was exactly what I was looking for, thank you!

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

Users online (3,037)