Hello,
I'm stumped. I have two apps that use the same data source. I am following these steps to create a duplicate of a record on both apps:
Gallery item OnSelect=
Set(varCurrentRecord, ThisItem); Navigate(EditForm1Screen)
Copy button on EditForm1 Screen =
UpdateContext({locCopy:true})
EditForm1 Item =
If(locCopy=true,
Patch(varCurrentRecord,{ID:Blank()},{Title: Blank()},{Status: Blank()},{CompletedDate: Blank()}),
varCurrentRecord
)
Submit Button on EditForm1 Screen =
SubmitForm(EditForm1)
On one app this creates the desired results of copying an item and making a new request. But on the other I get a Error =
Network error when using Patch function: The specified column is generated by the server and can't be specified.
I tried the process of elimination by removing each of the patch to blank items and it seems to be the ID that is causing the issue.
Anyone have any troubleshooting steps I could use to help find out why this error keeps popping up?
Solved! Go to Solution.
I figured it out, I had mistakenly added the 'Created By' card to the form and turned the Visibility off on it. 😖 I was using it's value to prefill another section in the app. I removed that card from the form and its working as it should now.
The error message is because you have specified an ID where SharePoint generates its own ID. Take out ID:Blank()}
But if I don't blank the ID I'm only editing the record that I am trying to duplicate. By blank the ID, Sharepoint is supposed to create a new record from what (I thought) I understood.
Nope. If you want to add a blank new record to a second data source simply Collect(list2, Defaults(list2)) and SharePoint will add the ID.
If you want to copy an existing record to the second data source, Collect(list2,ThisItem), If you want to specify only certain columns you can put them in the {...} part of the Collect() function like
Collect( IceCream, { Flavor: "Strawberry", Quantity: 300 } )
Thanks for the comments but my post may have been confusing. I was stating that both apps use the same Sharepoint data source. App 1 has no problems using the above formulas and submitting a new (copied) record. While App 2, using the exact same data source and formulas above, gives me the error. This is where I got the formulas from. Which looks like @RandyHayes may have helped come up with. I have successfully used this guide on 3 other apps as well. But for whatever reason I can't get it to submit for App 2, just the error. I must have a variable interfering or something.
I figured it out, I had mistakenly added the 'Created By' card to the form and turned the Visibility off on it. 😖 I was using it's value to prefill another section in the app. I removed that card from the form and its working as it should now.
User | Count |
---|---|
125 | |
87 | |
84 | |
75 | |
69 |
User | Count |
---|---|
215 | |
178 | |
140 | |
109 | |
83 |