Power Apps - writing data back to a SharePoint list

Christine L 0 Reputation points
2023-07-14T17:44:01.3466667+00:00

Hello,

I am new to Power Apps and am trying to correct my Patch function to successfully write data back to a SharePoint list. The list contains four fields: Date field, Person field, and two lookup fields. I created cascading drop downs in Power Apps, that work in Power Apps. However, without the Patch function, the two cascading drop down fields are not sending the data back to the SharePoint list. I will share the formula I found and updated it with my fields.

I am adding this Patch function to my Submit button.

Screenshot 2023-07-14 133842

The error is here:

WScreenshot error

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,166 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Vahid Ghafarpour 22,410 Reputation points
    2023-07-14T17:51:38.1066667+00:00
    1 person found this answer helpful.

  2. Christine L 0 Reputation points
    2023-07-14T18:41:16.13+00:00

    Good catch. I added the comma before the curly bracket, but now I have other errors. First this one; Am I using the wrong context here? Should ".Text" be something else? Update?screenshot2

    Trying desperately to get this first one under my belt so I can use this

    Screenshot3

    0 comments No comments

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. RaytheonXie_MSFT 38,576 Reputation points Microsoft Vendor
    2023-07-17T06:16:15.79+00:00

    Hi @Christine L,

    Per my test, if you want to update a date column. You could refer to following code

    Patch(
        'List Name',
        LookUp('List Name', ID=1),
        {
            DateColumnName: Date(2023,07,18) + Time(9,30,0)
        }
    )
    
    
    

    Here is the sample for Person column

    Patch(
        'List Name',
        LookUp('List Name', ID=1),
        {
            EmployeePerson: {
               '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
               Claims: "i:0#.f|membership|******@companyname.com",
               Department: "",
               DisplayName: "xxx",
               Email: "******@companyname.com",
               JobTitle: "",
               Picture: ""
            }
        }
    )
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.