Seeking a Clean Solution: Controlling Required Fields in a Reusable Element"

Hello, guys. How are you?
Is there a clean way to control required fields on a reusable element? I have a reusable element inside a form. The form itself will create a datatype (dtA), and the reusable element will create another datatype (dtB - related to “its parent”). So, I created a button on the form that will create dtA and will set a state on the reusable element to create dtB. Since I’m not creating dtB directly, the “this input should not be empty” is irrelevant.
I could make some kind of manual control (in fact, it’s what I’m doing) to check if the inputs are not empty… but that creates a mess and is not very clean.
I appreciate if someone could help me with this one!

If the form is static, one option is to create a property on the reusable using the required inputs - i.e they aren’t empty (y\n) and reference that

1 Like

Hey @DjackLowCode , thanks for the answer.
If i understood correctly, the ideia is to create a custom state ( yes/no) on the reusable. Then a WF to change the status to YES whenever the input is changed and is not empty. Repeat that for all the required fields…
On the Form Button, put a conditional that, if one of the custom states on the reusable is NO, show an alert… if all are YES, proceed with the WF.

Is that it?

@sylvioavilla - that’s the right idea. You can use the ‘property’ feature on the reusable so that it updates dynamically rather than having to set the custom state every time

1 Like

Ok, that makes much more sense, lol!

After trying your suggestion I found a cleaner solution.

Inside the reusable I created a Custom Event to Create/Edit the new record.
On the form, I set a WF for the button to first trigger the Custom Event Inside a reusable and then do the next steps. That triggers the required rules within the reusable, preventing the user to save empty fields!

Thanks again @DjackLowCode for your help!