IsRequired property for in_Argument not having any effect

Hello,

pretty much what is in the title. When I check IsRequired property for any in_Argument in a workflow and save it, there’s no validation error when I try to invoke that worfklow from above level.

This makes it pretty difficult to check whether there are some empty arguments left behind - especially since there is not a native UiPath way on how to check these (afaik).

Could pls someone check and confirm this?

My UiPath Studio version is 2021.10.5.

Thanks
Michal

1 Like

Hello Michal, Welcome to the UiPath community.
I was able to reproduce the behavior you reported locally in Studio version 21.10.5. Below are my observations and a workaround for this behavior:

  1. By ticking IsRequired you’re telling Studio to check there should be something provided for that argument, otherwise generate an error. The studio will be throwing an error here only if you run/debug the child workflow in isolation and Not when it gets invoked from a parent workflow.
  2. but that doesn’t mean what’s provided for the argument couldn’t have a value of Nothing (or null in C#), in which case the error in the above image doesn’t pop up
  3. so to be sure you have a valid argument to work with, it’s recommended to put an IF statement (called guard clause in other languages) along the top of the workflow to validate it first, and throw an exception if not validated.

Using guard clauses is in general a good practice in and of itself and should be applied wherever possible.

P.S. Please mark this reply as the solution if it helped in resolving your issue.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.