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 / How to add an If State...
Power Apps
Answered

How to add an If Statement that edits a form field upon submission

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

My current app is to help track a production rate and allows user to open a work order, close a work order, or enter a daily rate. Is there a way to have the submit button add in a note or edit a field that will help signify this? My first thought was to add another field with 3 choices (Open Work Order, Close Work Order, Enter Daily Rate) and upon submit have it select one of those choice, but I was unable to get a function to work.

MP18_1-1672941651804.png

 

MP18_2-1672941831337.png

Thank you,

 

Matt

 

Categories:
I have the same question (0)
  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Can you share the formula on your submit button?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Currently for my

    Start/Close Work order page I have

    SubmitForm(EditFormSEWO)

    For my Edit Daily Rate page I have

    Patch('Production Rates', Defaults('Production Rates'), EditFormEDR.Updates) because I haven't been able to get something to work. 

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    So it sounds like you want to patch or submit this information along with the other data?

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yes, thats correct. I want to submit a form and upon submission if possible have one of the fields auto-populated. 

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    How will the submit know which value to choose?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    That's what I was trying to figure out. I'm not sure how to incorporate an IF statement that would select an option on an form field. Because the pages are separate I was thinking that the 'Enter Daily Rate' would be easy and upon select it would pick an option, but the Open/Close work order would just be selecting one (Either open or close) and the other could be the default option on that screen.

     

    I guess the formula I would be looking for would be something that selects a value on a form field, then I would incorporate that function into an IF statement.

  • Verified answer
    JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    If you have a choice field already where Open/Close Work Order is selected, you would just use that value as the default value in your DataCard where you want it recorded.

     

    So your DataCardValueXX default value or text value would be something like:   XxxControl.Selected.Value and then it would automatically populate that column in your data source when the form is submitted.

     

    For the Enter Daily Rate, you could set a variable to 'Enter Daily Rate' on the button or icon you are using to navigate to that screen and then just patch the variable value to the Data source column.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard