Mark Logic Inputs as Optional

Is it possible to mark logic inputs as optional? I have a workflow where sometimes users select additional objects to pass to the function and sometimes don’t need to.

1 Like

Not currently, its something we are tracking and will be available soon (a couple of weeks).

1 Like

Gotcha! Is there a workaround I could use in the meantime?

When they land they will require you to provide a default value for when the input isn’t provided (we are tracking ‘nullable’ values independently) so it depends on exactly what the input is / what else uses your logic.

One option is to create a wrapping logic (or typescript) function that doesn’t accept the soon-to-be-optional parameter and just forwards a default value to the original, then depending on where you call it from you either use the original (where you can provide the value) or the wrapper when you don’t have a value.

1 Like

Hey, I was wondering if this had moved forward at all? Recently, I went through a similar process, having to pass lots of ‘null string’ values to an action in AIP logic (which had ‘not required’ parameters on both action config and function inputs).

One more thing - it seemed impossible to pass a nullable ‘Object Reference’ parameter as actually null, like you could for other type. I couldn’t create one in AIP Logic as far as I could see. As a result I had to rewrite the function to use the objectID instead of the object reference.