cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Need help with updating a Sharepoint List

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:

 

image.png

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Need help with updating a Sharepoint List

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,

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.

View solution in original post

11 REPLIES 11
Highlighted
Super User
Super User

Re: Need help with updating a Sharepoint List

Is ListID a column in SharePoint that you created?



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Super User
Super User

Re: Need help with updating a Sharepoint List

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.

Highlighted
Frequent Visitor

Re: Need help with updating a Sharepoint List

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).

Highlighted
Frequent Visitor

Re: Need help with updating a Sharepoint List

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.

Highlighted
Super User
Super User

Re: Need help with updating a Sharepoint List

Is the ListID column in SharePoint set to Enforce unique values?



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Community Support
Community Support

Re: Need help with updating a Sharepoint List

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:

2.JPG

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,

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.
Highlighted
Frequent Visitor

Re: Need help with updating a Sharepoint List

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.

 

 

Highlighted
Community Support
Community Support

Re: Need help with updating a Sharepoint List

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,

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.
Highlighted
Frequent Visitor

Re: Need help with updating a Sharepoint List

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:

 
 

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,644)