0

Is there a way to have an optional runtime parameter that defaults to an empty string and have it actually display an empty string?

Issue 1: When using an empty string, the parameter becomes required and the user must input something, otherwise the Run button remains disabled.

Issue 2: A workaround is to change the type from string to object, but then it awkwardly displays a single ".

Example:

name: required
displayName: Required
type: string
default:

name: obj
displayName: Object type
type: object
default: ""

name: objtwo
displayName: Object type
type: object
default: 

Screenshot of empty string and empty objects as runtime parameters

1

1 Answer 1

0

There is a similar question here, which suggests you can use a string parameter with a value of an empty space ' ' for a string. The UI treats the space as a valid input.

Sign up to request clarification or add additional context in comments.

2 Comments

As this comment says stackoverflow.com/a/65949329/3123147, it leaves the space there. So rather than being empty, it contains a single character of whitespace ` `.
Yes. If you're putting in a space, you'd have to check for space in your pipeline.trim( parameter.required ) would remove the spaces

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.