Hi all,
I would like to put this into one of my button but it seems like its not working as intended. The button are supposed to check if certain error message labels (ErrorMessage12, ErrorMessage14, etc.) are blank, and if they are, it updates a context variable named Draft to 0 and submits a form named Form25Bs. If any of the error message labels are not blank, it should show an error notification.
The code are as follows:
If(
IsBlank(ErrorMessage12.Text) &&
IsBlank(ErrorMessage14.Text) &&
IsBlank(ErrorMessage21.Text) &&
IsBlank(ErrorMessage23.Text) &&
IsBlank(ErrorMessage24.Text) &&
IsBlank(ErrorMessage26.Text) &&
IsBlank(ErrorMessage32.Text),
UpdateContext({Draft: 0}); SubmitForm(Form25Bs),
Notify("Error detected! Make sure that all fields are filled in without errors!", NotificationType.Error)
)
I had 4 issues with this formulas.
4 Issues detected.
1. Expected operator We expect an operator such as +, or & at this point in the formula.
2. Behavior function in a non-behavior property. You can't use this property to change values elsewhere in the app. Behavior functions change the state of the app by changing values elsewhere in the app. 'Navigate', 'Patch', updateContext, and 'Collect are common behavior functions. 'Onselect•, 'OnVisible', and other 'On properties are common behavior-based properties.
3. Incompatible type. We can't evaluate your formula because of a type error. The data may not match the expected type. (text, number, date, table, record.)
4. The function 'If' has some invalid arguments.
How should i fix my formula?