I am building an app that will collect data. There are quite a few fields and the Business Process Manager wants the user to be able to save the form to be able to come back to it later if needed. I have done this in the past in Infopath by setting a hidden field as a choice field in SharePoint with yes/no values and on form load set the value to yes and on submit to no so it can validate. I have a choice field in my current SharePoint list, and I think using the OnVisible property of the EditScreen is the correct place to put the formula/function. I couldn't find the correct syntax to get the value of the field to change back and forth on form load and submit. This is my first app since InfoPath, the transition is tough.
Thank you this makes it do what I was describing now.
Hi @ScottRMeredith ,
Do you add a Gallery in your app to list all available records from your SP List?
Do you mean that you need to reset the "Choice" field ("save" field) to "yes"when your Edit form is opened again, and the "save" field is "no"?
Further, have you taken a try with the solution I provided above?
According to the needs that you mentioned, I think the solution I provided above is in right direction. Please consider take a try with the following workaround using variable:
Set the OnSelect property of the "+" New button (click it to add a new entry) to following:
Set(ChoiceValue, "Yes");
NewForm(EditForm1);
Navigate(EditScreen1)
Set the OnSelect property of the "Edit" button (press it to edit an existing record) to following:
If(
BroseGallery1.Selected.ChoiceField.Value = "No",
Set(ChoiceValue, "Yes"),
Set(ChoiceValue, BroseGallery1.Selected.ChoiceField.Value)
);
EditForm(EditForm1);
Navigate(EditScreen1)
Set the DefaultSelecteditems property of the "Choice" field ("save" field) ComboBox in your Edit form to following:
{
Value: ChoiceValue
}
Set the OnSelect property of the "save" button to following (press it to save form data when you have not finished your form😞
Set(ChoiceValue, "No"); // Chanage the "save" field to "No" when you have not finisged the form
SubmitForm(EditForm1)
Set the OnSuccess property of the Edit form to following:
Set(ChoiceValue, Blank()); // Add this formula to clear variable
Back()
Please consider take a try with above solution, check if the issue is solved.
If you custom a form in your SP List using PowerApps, please set the OnNew property of SharePointIntegration control to following:
Set(ChoiceValue, "Yes");
Refresh('Your SP List');
NewForm(SharePointForm1);
Set the OnEdit property of the SharePointIntegration control to following:
Refresh('Your SP List');
EditForm(SharePointForm1);
Set(
ChoiceValue,
If(
SharePointIntegration.Selected.ChoiceField.Value = "No",
"Yes",
SharePointIntegration.Selected.ChoiceField.Value
)
)
Best regards,
Thank you for the response.
I don't think I explained the behavior I want in the form well enough. When a new form is opened, the default value is set to yes. This will be the variable that drives if the fields are required or not. If the user is not able to finish the form, I will have a save button that will change the value to no so the fields are not required. When they reopen the form to finish it, the value needs to be reset to yes. This way when they submit the completed form, all the required fields will still be required and when they click the submit button to move it along in the process, the button click will change a second status field so automate will know to trigger the workflow to move it along in the process. I hope that makes sense.
So I am trying to figure out where to put the command/function/formula whatever it is called now in PowerApps so when the edit form is opened it will set my "save" field back to yes if it is no, and what that command/function/formula would be.
Hi @ScottRMeredith ,
Do you want to set "Choice" field ComboBox value when you load your Edit form?
Actually, it is not necessary to type the formula within the OnVisible property of the Edit screen. I have made a test on my side, please consider take a try with the following workaround:
Unlock the Choice filed data card in your Edit form, then set the DefaultSelectedItems property of the Choice field ComboBox to following:
If( // when you load your Edit form screen to enter a new entry, the Choice filed ComboBox display "Yes"
EditForm1.Mode = FormMode.New,
{
Value: "Yes"
},
Parent.Default
)
Set the OnSuccess property of the Edit form (EditForm1) to following:
Patch( // Add this formula to set the Choice field to "No"
'Your SP List',
EditForm1.LastSubmit,
{
ChoiceField: {
Value: "No"
}
}
);
Back()
Please consider take a try with above solution, hopes it could help in your scenario.
Best regards,
WarrenBelz
89
Most Valuable Professional
MS.Ragavendar
60
stampcoin
48