Hi,
I'm struggling coming up with a logic to check if the record exist in the SharePoint list against the Collection.
If record existed in the Sharepoint then do not patch the record from the Collection
If record does not exist then patch the record from the Collection to the SharePoint.
Here is the patch function I created.
ForAll(Collection,
Patch(SharePointList,
Defaults(SharePointList),
{
Control: Control,
Name: Name,
GUID: GUID
}))
Thanks for your help
Solved! Go to Solution.
Hi @Spaceballs ,
Assuming you have the ID of the SharePoint list in your collection data
ForAll(
Collection As aPatch,
If(
IsBlank(
LookUp(
SharePointList
ID = aPatch.ID
).GUID
),
Patch(
SharePointList,
Defaults(SharePointList),
{
Control: aPatch.Control,
Name: aPatch.Name,
GUID: aPatch.GUID
}
)
)
)
If GUID is a unique identifier, you can also use that instead of ID.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
@Spaceballs
Similar question has been answered this post please have a look
https://powerusers.microsoft.com/t5/Building-Power-Apps/Patch-existing-records-and-add-new-records/m...
Hi @Spaceballs ,
Assuming you have the ID of the SharePoint list in your collection data
ForAll(
Collection As aPatch,
If(
IsBlank(
LookUp(
SharePointList
ID = aPatch.ID
).GUID
),
Patch(
SharePointList,
Defaults(SharePointList),
{
Control: aPatch.Control,
Name: aPatch.Name,
GUID: aPatch.GUID
}
)
)
)
If GUID is a unique identifier, you can also use that instead of ID.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
User | Count |
---|---|
124 | |
87 | |
86 | |
75 | |
69 |
User | Count |
---|---|
214 | |
181 | |
140 | |
96 | |
83 |