Custom Sharepoint Online List Form - Change Required Property of a field depending on dropdown value
I'm new in using PowerApps and still trying out new things with it particulary with it's integration with Sharepoint Online.
I'm currently doing this customized sharepoint list form, and there are some conditions where I have to set some fields as Required depending on the selected value in a dropdown. On the column definition I have set this fields as Not Required, and I was thinking I'll just do the validation via powerapp.
At first I tried to do it via the Rule function, but unfortunately you cannot change the field property using the UI.
So I tried to do some reading and tried the following:
I added this condition on the OnSuccess field of the form. I don't have a custom button because with Sharepoint Online the save button is visible and working by default.
If(DataCardValue14_1.Selected.Value = "Study Leave" && IsBlank(DataCardValue24_1.Text), Notify("Event Name is required for Study Leave Request", NotificationType.Error), SubmitForm(NewLeaveRequest_1))
This doesn't do anything.
So what I did is created a new custom form, and added a custom save button, added the code to the OnSelect of that button, and it works on that form. It's weird because, it isn't working against a default save button, that is what I wanted to achieve..
Is there another way to change the Required property and alert the user that the fields are require? I'm a bit unsure with Notify method because, there are multiple fields that needs to be validated.