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

Updating Powerapps collection with new item and adding in Sharepoint list without duplicates of previous Data

Hi, I wanted to know if this is possible,
i made a collection and added the data in sharepoint list by using,

ForAll(CollectionName, Patch(SharePoint_ListName, Defaults(SharePoint_ListName), { ColumnName1: value1, ColumnName2: value2, etc})

Now, i want that if i add a new item in the collection then the new Item + the old data in the collection be added in sharepoint list without duplicating the previous inserted data.

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @Anonymous 

 

Yes, you can add an If condition before Patch() function to check if the record exists.

ForAll(CollectionName,
If(IsEmpty(Filter(SharePoint_ListName,ColumnName1=value1 && ColumnName2=value2 && etc)),
Patch(SharePoint_ListName, Defaults(SharePoint_ListName), { ColumnName1: value1, ColumnName2: value2, etc})))

Hope this helps.

Sik

 

View solution in original post

2 REPLIES 2
eka24
Super User III
Super User III

Please this post:
https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-check-if-record-already-exists-in-a-f...

 

 

If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

v-siky-msft
Community Support
Community Support

Hi @Anonymous 

 

Yes, you can add an If condition before Patch() function to check if the record exists.

ForAll(CollectionName,
If(IsEmpty(Filter(SharePoint_ListName,ColumnName1=value1 && ColumnName2=value2 && etc)),
Patch(SharePoint_ListName, Defaults(SharePoint_ListName), { ColumnName1: value1, ColumnName2: value2, etc})))

Hope this helps.

Sik

 

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,115)