Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Need help with updating a Sharepoint List

(0) ShareShare
ReportReport
Posted on by 15

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!

  • JFrisbee Profile Picture
    JFrisbee 15 on at
    Re: Need help with updating a Sharepoint List

    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

  • Verified answer
    v-xida-msft Profile Picture
    v-xida-msft on at
    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,

  • JFrisbee Profile Picture
    JFrisbee 15 on at
    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:

     
     
  • v-xida-msft Profile Picture
    v-xida-msft on at
    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,

  • JFrisbee Profile Picture
    JFrisbee 15 on at
    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.

     

     

  • v-xida-msft Profile Picture
    v-xida-msft on at
    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,

  • Jeff_Thorpe Profile Picture
    Jeff_Thorpe 6,085 on at
    Re: Need help with updating a Sharepoint List

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

  • JFrisbee Profile Picture
    JFrisbee 15 on at
    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.

  • JFrisbee Profile Picture
    JFrisbee 15 on at
    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).

  • WarrenBelz Profile Picture
    WarrenBelz 145,666 on at
    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard