Showing results for 
Search instead for 
Did you mean: 
Helper IV
Helper IV

Field update as part of submit rule

Let's say I have a PowerApp which is a custom SharePoint list form.  In the list, there is a field called "Status" which is a choice column with 3 values:  New, Submitted, Approved.  When a user creates a new form, status defaults to "New" and the status field is displayed in View mode so that it can't be changed.  When the user clicks the "Submit" button, I want the status field to update to Submitted status and then the form to be saved.  I'm not clear on the syntax for updating that Status column value in code prior to form submission.  I am sure it is easy but can anyone give me a hint?

Advocate V
Advocate V

Hi @blanghorst,


You need to create a new variable (like varStatus) and set the default value of Status field to varStatus whereas items os status  be New, Submitted, Approved. 


Then, OnSelect property of button submit, assign varStatus value to "Submitted" and save/submit the form like

OnSelect = UpdateContext({varStatus:"Submitted"}); SubmitForm(Form1)

Hope this will help you.


- Nabin

Thanks!  I'll give it a shot.

Hi Nabin,


So, I tried this and ran into a problem.  Correct me if I'm wrong, but I think you're saying the following:


1. Use a variable called varStatus to store the Status value.

2. Set the default value of the Status column to varStatus.

3. Place the rule in your post on a button.  When the button is clicked, it will update varStatus and therefore, the Status column.


If I try to place varStatus in the Default value,  I get a "The property expects Table values, but this rule produces incompatible Text values."  Keep in mind that the "Status" field is a lookup column in SharePoint, and I need to do the following:


1.  When a new form loads (MyForm.Mode=FormMode.New0, I need to set the Status field to show "New."

2.  When I click the SUBMIT button, I need to update that field to "Submitted."


So I'm thinking that varStatus has to be some sort of lookup to the choice column where we filter it to Value=New, but I can't quite get that working either.  I placed the formula below in the Default value for the Status column and the Status field still is empty when I open a new form:


    MyForm.Mode = FormMode.New,
        Value = "New"),


One other thing I mentioned - the field is currently in View mode.  Could that be the issue?





I got it working.  Here is what I did so far:


1.  On the status field, I changed the field to "Edit Lookup" from "Edit Selection" (not 100% sure if it was necessary).

2.  On the default value for the Status field, I entered:  If(IsBlank(varStatus),Parent.Default,varStatus)

3. On the Submit button, I entered:


UpdateContext({varStatus:LookUp(Choices('ListName'.'Status'),Value = "Pending")});SubmitForm(SharePointFormName)


Now, when I submit my form, it changes the status to "Pending" upon submission exactly how I wanted.



Community Support
Community Support

Hi @blanghorst,

Have you solved your problem?

Based on the needs that you mentioned, I think it is not necessary to change the Status field (Combo Box) control from "Edit selection" to "Edit Lookup". In addition, it is also not necessary to initialize a variable to store the Status value.

I have made a test on my side, please take a try with the following workaround:6.JPG



Set the DefaultSelectedItems property of the Combo Box control within the Status Data card to following:


Set the OnSave proeprty of the SharePointIntegration control to following:


Set the OnSuccess property of the SharePointForm1 control to following:


On your side, you should type:

       Status: {
Value: "Pending"
} } ); ResetForm(SharePointForm1);

Please take a try with above solution, check if it help solve your problem.

If you have solved your problem, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify.


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.

To be clear, mine is a dropdown list populated by a choice column in SharePoint.   It would've been easier had the person who built the list just made the Status field a text box because no one will ever actually manually specify a status.  Thanks for the information below, however - I will definitely take a look and keep it in mind.  I did get mine working per my previous post with only one little glitch, but it isn't important for me to resolve it at the moment.

Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,374)