web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Updating a field value...
Power Apps
Answered

Updating a field value after just before form is submitted

(0) ShareShare
ReportReport
Posted on by 316

Hi,

I have two data cards, one is a combo box and the other is Text Input, both are connected to a SharePoint list as Data sources and both are text fields in SharePoint (the SST being a text 'Yes' or 'No'field:

Iamglt_0-1615258338548.png

When the Combo box has 'In-Progress' selected and the SST Emailed field = 'No', I run a workflow with the following code:

If(
 ComboBox7_2.Selected.Value = "In-Progress" And DataCardValue2_2.Text = "No",
 Set(
 varMailSentDate,
 'NewEmployeeOnboarding-CheckForm'.Run(
 varSendEmail,
 varClientName
 ).varemailsentdate
 );
 Set(varEmailent,"Yes");
):
SubmitForm(frmDetails);

But before the form Submits in the code above, I want to be able to set the DataCardValue2_2.Text = "Yes" (which is the SST Emailed field on the form), so that value is written back to SharePoint.  I understand I can use a patch, but is there a way to change this form by setting the Datacardvalue and then submitting the form?

Cheers,

G.

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Iamglt ,

     

    Would you like to change a TextInput box value before submit the form?

     

    If so, you could leverage several variables to achieve that need. Follow the steps below:

    1\ Set a variable OnVisible of the Screen:

    Set(varYes,false)

     

    2\ Set OnSelect of the submit button:

    If(
     ComboBox7_2.Selected.Value = "In-Progress" And DataCardValue2_2.Text = "No",
     Set(
     varMailSentDate,
     'NewEmployeeOnboarding-CheckForm'.Run(
     varSendEmail,
     varClientName
     ).varemailsentdate
     );
     Set(varEmailent,"Yes");
    );
    Set(varYes,true);
    If(DataCardValue2_2.Text = "Yes",SubmitForm(frmDetails));
    Set(varYes,false)

     

    3\ Set Default of the TextInput which is DataCardValue2_2 on your end to:

    If(varYes=true,"Yes",Parent.Default)

     

    The process means once click the submit button change the variable to true then the DataCardValue2_2.Text turns to be “Yes” and submit the form.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Are you saying you cannot directly change the text attribute of a field?

    set(field1_Datacard1.text ="xyz")?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard