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

Notifications

Announcements

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
    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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard