Set variable to '[blank]' using data picker

If I want to set a variable to blank, the data picker won’t allow this, it always says 'Field is required!'

image

I can add a single space (which is not what I want) and then I have to adjust the code by removing the space in code view from
'business_ID_var.setValue(' ');' to
'business_ID_var.setValue('');'

This is not ideal. I may make several changes to an Action and may forget to go through this process which could screw things up.

Is there another way?
Can we remove the need for a field/value requirement?

1 Like

Not sure it is any easier than what you do, but I type null into the code view of the data binding:

Side note, this produces a null, rather than an empty string, which are different things.

This is a solution but I would still rather be able to put a blank in this particular case.

Bump

In client-side actions, you can just put '' in code view or alter the code in code editor. I tend to put something like xx in so that is saves and then go to code editor and remove the xx. It would be good to be able to use blank strings, though.

Hi Ben, yes that is what I was trying to say in the original post, it requires another step rather than just accepting [blank].

There’s always the danger that as you are testing and tweaking things that you forget to edit this for the umpteenth time, which could cause problems at a later date.

It would be great if it would simply accept [blank] or '' (without a space in the middle)

1 Like