For my flow I need the length of my string… is there any way to do this? I tried {{ length ( ‘test’ ) }} and several variations to this but no luck so far.
The better logic app has much more options, maybe this command works with that app
Can be done with
{{ size("[string]") }}
But it returns the string [6]
instead of a numeric 6
( in case the calculated length is 6 that is)
I could only solve it with use of a little Homeyscript code
The code:
// Filter the number out of the string size
var response = args[0];
const stringSize = '' + response.split("[")[1].split("]")[0];
return Number(stringSize);
Couldn’t get a numeric value out of it with Better logic, the result is a JSON, but the logic JSON extraction cards only accept string variables, not numeric ones
Source: Mathjs.org
Thanks so much… this works great!
1 Like