Skip to main content

Search

Verifying required fields before executing script

Comments

6 comments

  • Matthias Walter

    Hi Heikki Salminen,

    to overcome this problem, you could add a condition to each action before the save action which checks if the required fields are not empty:

     

    Cheers Matthias

    0
  • Salminen Heikki

    Hi Matthias Walter

     

    Seems to work. Even better way is to use the expression builder to keep the Save-button disabled until all required fields are filled in.

     

    Br, Heikki

    0
  • Christof Nussbaumer

    Hi Heikki Salminen

     

    The required field validation is not working with button disabling neither with Rich Forms nor in SharePoint ootb forms.

    But you're right, with Rich Forms you're able to configure an "Enabled Condition" on your buttons with an expression that checks the field on filled in values.

     

    Feel free to share your experiences with us about this case

    Thank you!

    0
  • Salminen Heikki

    Hi

     

    I've been playing with this for a while. If there are more than just a few mandatory fields and more than a couple of actions, it's quite time-consuming to add all conditions to each step. It would be good if there was a way to validate all mandatory fields in single step and if it fails, then show an error message and jump out of the sequence.

     

    Br, Heikki

    0
  • Matthias Walter

    Hi Heikki Salminen

    unfortunately this is not possible with the current architecture since each action is evaluated separately.

    But there is probably a better way from a performance perspective. With the current configuration it would check the required field many times again and again, but this could be optimized to store the result once in a window variable and just access it from every action afterwards.

     

    So in the first action simply store the result of the check into a window variable (I just named mine formvalid) and return it on the same line.

     

    In the following actions you can now access the condition directly from the window variable which makes it much faster and you have the logic just at one place if it changes later.

     

    BR Matthias

    0
  • Salminen Heikki

    Hi

     

    I finally had time to test windows-variables, and they seem to work. I think this is a working way to do the trick, thanks!

     

    Br, Heikki

    0

Please sign in to leave a comment.