Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Update Item from Form

(0) ShareShare
ReportReport
Posted on by 4,700 Super User 2025 Season 1

I have Form1.

 

I have SPList1.

 

SPList1 has a choice 'Status' column that is displayed in Form1.

 

In the 'OnSuccess' of Form1 I have an 'Update' formula that changes the content of the 'Status' column.

 

Since I am already in the 'OnSuccess' of Form1, displaying the relevant and associated data, do I STILL need to reference the 'ID' of that item in the update formula in order to update the 'Status' of said item?

 

Or, will this automatically only update the Status for the item currently displayed in Form1?

Categories:
  • Verified answer
    MudassarSZ365 Profile Picture
    591 on at
    Re: Update Item from Form

    @Phineas ,

    put this code on the onsuccess property of the form

     

    Patch(SPList1, Form1.LastSubmit, {Status: {Value: "Approved"}})

     

    If you want to use a button outside of the form submission process to update the 'Status', you should put tis code on the onselect property of the button

     

    Patch(
     SPList1, 
     LookUp(SPList1, ID = Form1.LastSubmit.ID), 
     {Status: {Value: "Approved"}}
    )

     

    Or, if you already have the ID available in a text input or data card value named RequestFormItemID_DataCardValue, you could use:

     

    Patch(
     SPList1, 
     LookUp(SPList1, ID = Value(RequestFormItemID_DataCardValue.Text)), 
     {Status: {Value: "Approved"}}
    )

     

    If this explanation is helpful to you, please consider accepting it. 😊

  • Phineas Profile Picture
    4,700 Super User 2025 Season 1 on at
    Re: Update Item from Form

    If I have a button within Form1, that is NOT submitting the form, the following should update the 'Status', yes?
         Update('SPList, ID = Value(RequestFormItemID_DataCardValue.Text), {Status: {Value: "Approved"}})

    In the Form1 'OnSuccess' I currently have the following formula -
         Patch(SPList1, LookUp(SPList1,ID = Form1.LastSubmit.ID), {Status: {Value: Approved}})

    You're saying all I need is the following, yes?
           Patch(SPList1, Form1.LastSubmit, {'Status': "Approved"})

    Assuming all the above is true, both versions would work, yes?

  • MudassarSZ365 Profile Picture
    591 on at
    Re: Update Item from Form

    Hi @Phineas ,

    You can try this 

    Patch(
     SPList1, 
     Form1.LastSubmit, 
     {'Status': "NewStatus"}
    )

    If you find this explanation helpful, please consider accepting it. 😊

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,618 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,957 Most Valuable Professional

Leaderboard