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?
@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. 😊
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?
Hi @Phineas ,
You can try this
Patch(
SPList1,
Form1.LastSubmit,
{'Status': "NewStatus"}
)
If you find this explanation helpful, please consider accepting it. 😊
WarrenBelz
146,618
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,957
Most Valuable Professional