In a Server Action step, I want to perform a Set Value to assign an empty string…
So I have these lines:
but the following error is thrown when the server action is run:
How can I do this?
In a Server Action step, I want to perform a Set Value to assign an empty string…
So I have these lines:
but the following error is thrown when the server action is run:
How can I do this?
In the Set Value data picker, go to code view; entering null
(with no quotes) should solve it:
Null is not the same as empty string. In code view try entering ' '
(empty space) for the value.
@Teodor, I tried doing that and Wappler doesn’t seem to save it. When I set that and save and re-open the Set Value action, then value has changed from ' '
to just be blank and then the error occurs again. I’m using Wappler version 3.2.0.
Add it without the quotes '
i added them because i can’t show an empty space here
If you do this:
Then it results in:
Okay, I’ll give that a go when I’m back in that piece of code later on today.
Of course, what you are doing here is not creating an empty string, you are creating a string containing a space character.
Is there a way to initialise a Set Value to an empty string?
What exactly are you trying to achieve?
I want to initialise the variable to an empty string so I can concatenate values to it within a repeat in a repeat, so like this:
repeat A
Set Value my_string = empty string
repeat B
Concatenate values to my_string
Write my_string to a database field value
Oh great @teodor…
I see, I didn’t have the {{}}
around the ''
… I’ll try that option out!
It worked! Thank you!
This has been improved in Wappler 5.2.1 - now you can leave the value input empty, when setting a value, so you don’t have to add an empty space in code view.
This topic was automatically closed after 46 hours. New replies are no longer allowed.