cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kidvallejo
Helper III
Helper III

Sharepoint Patch

I am collecting a SharePoint list, allowing the user to adjust some text fields and then patch back to SharePoint when done. However, today I am suddenly getting errors saying one field is read only (modify currently- but this has changed throughout the day).

I tried collecting only certain fields but as soon as it patches it defaults and shows all the fields in the collection, any ideas?
5 REPLIES 5
v-xida-msft
Community Support
Community Support

Hi @kidvallejo ,

Could you please share a bit more about your issue?

How do you patch data back to your SP List? Could you please share a bit more about the formula?

How do you collect certain fields from your SP List into a Collection? Could you please share a bit more about the formula?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. I assume that you use Patch function to patch data back to your SP List, is it true?

Please check if you have added some System fields as Modified field within your Patch formula. The Created, Created By, Modified, Modified By, etc are all System fields in SP List, which would be generated automatically by SP Server automatically. You could not add these System fields as Modified fields within your Patch formula.

The standard format of Patch formula as below:

Patch(
         'YourSPList',
          Defaults('YourSPList'),
          {
            Column1: "xxx",
            Column2: "xxx",
            ...
          }
)

If you want t patch the modified collection data back to your SP List, please take a try with the following formula:

ForAll(
          YourCollection,
          Patch(
                  'YourSPList',
                   LookUp('YourSPList', ID = YourCollection[@ID]),
                   {
Title: YourCollection[@Title] Column2: YourCollection[@Column2], Column3: YourCollection[@Column3], Column4: YourCollection[@Column4], ... } ) )

 

In addition, if you want to collect only certain fields from your SP list into a Collection, please take a try with the following formula (set the OnStart property of App to following😞

ClearCollect(
               YourCollection, 
               ShowColumns('YourSPList', "ID", "Title", "Column3", "Column4", ...)
)

Please consider take a try with above solution, then check if the issue is solved.

 

More details about the ForAll function, Parch function, ShowColumns function, please check the following article:

ForAll fuction

Patch function

ShowColumns function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello Originally, I used the following formula:

Collect(Line, SP_Line)

Patch(SP_Line, Line)

 

This was working fine which is what has thrown me.

 

I have started to put in your method, but I now have delegation warnings all over the place? My sharepoint list could potential end up with 000's of entries how do I sort these out?

 

Thanks

 

kidv

Please be aware that I only collect 20-30 items at a time from the SP list, before patching back.

Hi @kidvallejo ,

Could you please share more details about the Delegation issue with your formula? Could you please share a screenshot about it?

 

Based on the Patch formula you provided, I think there is something wrong with it. If you just want to add data from your Collection into your SP List rather than modify records in your SP List, please modify your formula as below:

Patch(SP_Line, Defaults(SP_Line), Line)

If you want to modify records within your SP list based on your Collection data, please take a try with the following formula:

ForAll(
          Line,
          Patch(
                  SP_Line,
                   LookUp(SP_Line, ID = Line[@ID]),
                   {
Title: Line[@Title] Column2: Line[@Column2], Column3: Line[@Column3], Column4: Line[@Column4], ... } ) )

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello, 

 

Please see below... this is the formula I am using... sorry if I am missing something but as far as I can tell my formula is correct?

 

Delegation.PNG

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (39,318)