How do we create optional arguments for library activities made with coded workflows?

Right now, in the Activity Layout menu for coded workflows the ‘Required’ option is always checked true and disabled for user interaction. Additionally, Placeholder does not function correctly with coded workflow activities.

@edevries

ideally you would declare optional in execute itself by assigning a value or null. then that argument becomes optional

cheers

Ideally, I agree. Though, in the current state I don’t think default arguments on the [Workflow] tagged method actually changes the low-code activity interface like you would expect.

@edevries

are we talking about coded or lowcode? if normal low code workflow then from properties we can select right?

cheers

I was speaking specifically about when you build a library low-code activity using a coded workflow.

Usually when I build libraries, I’ll do it all in C#, but then wrap some of the functionality in minimal coded workflows for low-code users.

@edevries

interesting it looks like a bug

I tried publishing and checking even if it says requried when we publish and dont pass any values either for a argument with default value or without default value it does not throw any error

so basically the required options shows checked but is not considered anywhere

cheers

Please refer below Solution:
To create an optional argument in a library or activity - Help / Studio - UiPath Community Forum