cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Add to text field and submit a form when a button is pressed

I am sure this is a very stupid question but I am failing to figure it out.

 

What is the best way to insert into a text field and submit a form when a button is pressed? 

 

I using a SharePoint list as the data source.

 

This is what I thought would be the correct way to do it, however, it is not working:

UpdateContext({Status_DataCard1:"Pending"});SubmitForm(EditFormSave)

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: Add to text field and submit a form when a button is pressed

Set the text in a variable and keep the default property of the label to this variable.

Something like:

UpdateContext({textVar:"Pending"});SubmitForm(EditFormSave)

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

7 REPLIES 7
Highlighted
Super User II
Super User II

Re: Add to text field and submit a form when a button is pressed

Set the text in a variable and keep the default property of the label to this variable.

Something like:

UpdateContext({textVar:"Pending"});SubmitForm(EditFormSave)

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

Highlighted
Super User II
Super User II

Re: Add to text field and submit a form when a button is pressed

Also if Pending is a value of an Option Set you will have to reference it a bit differently.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com
Highlighted
Super User III
Super User III

Re: Add to text field and submit a form when a button is pressed

Set a variable on the SubmitButton : Set(MyText,"Pending");
SubmitForm(EditFormSave)

Then in the default of the textbox put the variable name: MyText
Highlighted
Advocate I
Advocate I

Re: Add to text field and submit a form when a button is pressed

Your solution did work for adding text when a button is pressed @PowerAddict . However, now I realized that I will need a way for the text to disappear when a new form is created. 

 

I am trying to create a save and submit buttons for my app my using a column named "Status". My plan was to insert "Pending" when the save button is pressed and "submitted" when the submit button is pressed.

Highlighted
Super User II
Super User II

Re: Add to text field and submit a form when a button is pressed

If you simply want your text to disappear when you are creating a new record, set the Default property of the label to:
If(FormName.Mode = FormMode.Edit, "Pending", Parent.Default)

The second part of your question: IS the only remaining part where you want to set the value to Submitted when the Submit button is pressed? Is this also in the same label that we have been referencing here?

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com
Highlighted
Advocate I
Advocate I

Re: Add to text field and submit a form when a button is pressed

I solved the problem of the text not disappearing by hiding that data card on the edit screen, since the user will not need to see it. Thank you for your help! @PowerAddict 

Highlighted
Super User II
Super User II

Re: Add to text field and submit a form when a button is pressed

Glad I could help! Good luck with the rest of the app! Feel free to reach out in case of any questions!

Thanks!
Hardit Bhatia
https://thepoweraddict.com

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,481)