Inputs - API or Functions - Default Values

Options
I would like to understand the use of "default values" ... for e.g. I have a function with a Input testValue, I set DEFALT VALUE e.g. "123" when a call the function returns empty value .... so what is the use of this "DEFALT VALUE"?  (In my case if this works as I thought, returning "123", would awesome and reduce a lot of consistence checks and procedures ) Thanks in advance! ... if it is just "informative" for documentation... would be very good have a simple filter to set a "defaultvalue_ifempty" 😂
[image.png]

Comments

  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
     check out the set_ifnotnull, set_ifnotempty, and set_conditional.

    Those all work with a path or an empty path, so it can do exactly what you are explaining. If the path is empty, then it replaces the entire value.
  • Daniel Rjeili
    Options
     but its not about the path, its just about pure variable value as it is ... what I am suggesting when you configure the input variable there is no filter option for set default value 

    [image.png]
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
     - Sorry but I'm not following you. There is a default value - I can see it in your own screenshot on the left.
  • Daniel Rjeili
    Options
     , yes there is a Default Value field when you configure the input, but I tried to set this value e.g. for "123" ... then I run debug to see if in the flow of the function stack this input testValue and was empty. thats why I asked "what is the use for this "Default value field"
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
     I made a quick loom video - check it out and let me know if this clears things up. https://www.loom.com/share/62581f801188420ab1768ab9f91cec90
  • Daniel Rjeili
    Options
     now clarified the understanding about the "default value", only when it is not informed (nonexistent) it is assigned. I was thinking when the input value was null, but you're absolutely right null still is a value. It was a mixture of lack of understanding on my side about how the "default value" works, with a try of "shortcut" to me don't need to consist the data informed in the function stack with a statement: "if ( testValue = null) then ... else ... ". Thank you very much for the video !!!
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
    I just noticed a subtle bug in the run&debug... required means needs to be present and non-empty.... this will be fixed in the release tomorrow.

    The API enforces that but the run&debug was slightly different.
  • Daniel Rjeili
    Options
     so my doubt in other side was useful to identify this. Virtuous cycles 😊👍👍