I have canvas app with a SharePoint list as a data source. I have a field called Traveling that is required if the FormMode = New is true and EmpType = Contractor/StaffAug else it is only required if HREdit.Mode = New is false. The following is the formula in Traveling.Required:
If(
HREdit.Mode = New,
If(
EmpTypeDataCardValue18.Selected.Value = "Contractor/Staff Aug",
true,false
),
true
)
The formula in the Submit button OnSelect property is as follows:
If(HREdit.Valid,SubmitForm(HREdit))
The OnSuccess property of the HREdit form is as follows:
Reset(txtSearch);Navigate(Gallery2,None);Set(varResetDir,true);Refresh(Onboarding)
When testing the app, the OnSuccess property of the HREdit form seems to run sending the user to the Gallery and displaying the required field error at the top of the gallery. Why is the form submitting if the form is not valid? The Traveling field is a dropdown choice field and not a combo box.
Thank you in advance.
You don't need all the redundant true false statements with an If, the following formula will already return a true or false:
(Parent.Mode=FormMode.New && EmpTypeDataCardValue18.Selected.Value="Contractor/StaffAug") || !(Parent.Mode=FormMode.New)
Next... the question is, what is your Update property?
Keep in mind that if the Update has ANY value and the datacard is marked as required, then it is Valid.
User | Count |
---|---|
253 | |
106 | |
94 | |
50 | |
39 |