Originally the Powerapp I created for our company (a basic onboarding form which stores the info in a Sharepoint list) worked without issue. Since Powerapps has been updated over the last year, the functionality has slowly been breaking. Now, the issue is what used to work as a SubmitForm no longer does, with the following error:
I gather the SubmitForm needs to change to an Update function, but I'm lost as trying the function previously would error out *and working with Microsoft's techs previously*, SubmitForm was the fix!
This solution works - I still get errors if I don't refresh the app in between multiple edits, but for our purposes this is fine.
Thank you,
Jason
Hi @JFrisbee ,
Could you please share a screenshot about the error in your canvas app?
Have you taken a try to re-generate a new app based on your SP List data source?
Please consider modify your formula as below:
Refresh(Onboarding); // Add formula here
Patch (
Onboarding,
LookUp(Onboarding, ListID = Value(DataCardValue1_2.Text)),
Form1_2.Updates
);
Navigate(HRLanding,ScreenTransition.Fade)
Best regards,
What am I going to screenshot? The error? The process of it not updating?
I removed & reconnected to the Sharepoint list, which didn't change anything visibly.
I was able to get it to work a few times with the following code on the submit button:
Patch (
Onboarding,
LookUp(
Onboarding,
ListID = DataCardValue1_2.Text
),
Form1_2.Updates
);Navigate(HRLanding,ScreenTransition.Fade)
After a save and refresh, now I get the error:
Hi @JFrisbee ,
Could you please share a screenshot about the issue?
Actually, the "This formula uses scope, which is not presently supported for evaluation" message is not an error, it is just a Intelligence prompt message from the Formula bar box in your PowerApps Studio (it's a normal behavior).
Please refresh your SP List data source manually before executing the Patch function, then check if the formula works well. Also please consider remove the old SP List connection from your canvas app, re-create a new connection to your SP List from your canvas app, then check if the issue is fixed.
Do you want to bind the ScheduledOnboarding.Selected.ListID formula to the ListID_DataCard1_1? Please set the Default property of the Text Input box within the ListID_DataCard1_1 to following:
ScheduledOnboarding.Selected.ListID
Best regards,
Thanks Kris, Jeff -
I've turned off unique values, and tried to use the Patch function, with the same relative errors I encountered when I first set the app up. Currently it isn't patching, and doing a search for ListID in a Lookup gives me the error "This formula uses scope, which is not presently supported for evaluation". I tried pointing to the data card (which is hidden), which gave me the ListID number stored (both in the Sharepoint list and Powerapps as a number) but because it sees the data card as a *text* field, it regards it as text and therefore the wrong format.
Also, somewhere I have ScheduledOnboarding.Selected.ListID as an option, and I have NO idea where in the app the variable is.
Hi @JFrisbee ,
Is the "ListID" column a custom Number column in your SP List?
Have you taken a try with Patch function to update/add items in your SP List?
Further, have you enabled "Enforce unique values" option for your "ListID" column?
Regarding the error message that you mentioned, it seems to tell that you are updating the "ListID" column with duplicates value. Please check if you have enabled "Enforce unique values" option for your "ListID" column as below:
If yes, please disable the "Enforce unique values" option for your "ListID" column in your SP List, then try your SubmitForm function in your canvas app again, check if the issue is solved.
In addition, if you want to add new entry or update existing items in your SP List, the Patch function could also achieve your need:
For Adding new entry:
Patch(
'Your SP List',
Defaults('Your SP List'),
EditForm1.Updates
)
or
Patch(
'Your SP List',
Defaults('Your SP List'),
{
Title: "xxxx",
Column1: "xxxx",
Column2: "xxxx",
...
}
)
For updating existing item:
Patch(
'Your SP List',
LookUp('Your SP List', ID = BrowseGallery1.Selected.ID),
EditForm1.Updates
)
or
Patch(
'Your SP List',
LookUp('Your SP List', ID = BrowseGallery1.Selected.ID),
{
Title: "xxxx",
Column1: "xxx",
...
}
)
If you want to populate the "ListID" column with Auto-Increment value when you add a new entry in your SP List, please try the following formula:
Patch(
'Your SP List',
Defaults('Your SP List'),
{
Title: "xxxx",
ListID: CountRows('Your SP List') + 1,
...
}
)
Best regards,
Is the ListID column in SharePoint set to Enforce unique values?
I've reviewed all the cards on the form, and ListID_DataCard1_1 is the only one - it's also hidden, as it behaves as an index.
Hi Jeff, yes - ListID is an index column I created in the Sharepoint list (the app would not index with the default Index column, so it is untouched/ignored).
Hi @JFrisbee ,
You seem to have to Data Cards both trying to update the field ListID. Remove one of them.
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.