Hi everyone, I am trying to build a form that allows users to save, edit the draft and also submit once the form has been completed. This is my first time trying to use powerapps, and would really appreciate if someone can please help me out.
I created a home screen to show the progress (see below). However, whenever I go back to edit the 'save as draft' form, a new form starts and carries some information from the last form. If I keep using the save function, more records will be created as drafts. Also when I click 'start a new form' it also shows some information from the previous form record.
Is there a better way to do this type of form on powerapps? Looking forward to having your help.
Hi @jaz_12
I believe the issue here is the order of execution. When you click on Save or Submit It sets the variable and submits the form. Data card (Status row update) may not be updated before submit form operation happens.
No guarantee of the order of operation. To solve this, we have 2 options
Option 1: Submit the form and Set the status OnSuccess property of Form
Patch(
Datasource,
LookUp(Datasource, ID = Form.LastSubmit.ID),
{
Status : If(locIsSubmit,{Value:"Submitted"},{Value:"Draft"})
}
)
Option 2: Use Patch command for each button
For example, OnSelect of Save button to
Patch(
Datasource,
If(
EditForm1.Mode = FormMode.New,
Defaults(Datasource),
LookUp(
Datasource,
ID = Gallery.Selected.ID
)
),
{
Status : {Value:"Draft"},
//Other fields
}
)
The same goes for submit button
Status : {Value:"Submitted"},
Hi @jaz_12
Please let us know if anything needs on your post. We can help with this.
Please do not forget to give kudos if you find the suggestion helpful or Accept it as a solution if works fine to help other users to find it useful.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
260 | |
127 | |
86 | |
85 | |
68 |