Let's assume the variable {{example}}
outputs the values 'KEY-1, KEY-2, KEY-3, KEY-4'. This variable is created to store object keys from lookupObjects
.
Using the split
function or other text string functions, how can we split the content of the variable {{example}}
in half so that the first part {{part1}}
outputs 'KEY-1, KEY-2' and the second part {{part2}}
outputs 'KEY-3, KEY-4'?
The solution should be applicable regardless of how many keys {{example}}
contains, whether it be any number between 1 and 100.
As creating a variable puts out as a string, I think it should be possible to the use the variable with the split option.
{{example.split(",")}}
I currently have not time to test this myself, but I hope this might help you forward.
Hi, see my reply to @Alex Koxaras _Relational_ - I am not looking for solution to split each value. Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Then there is no solution ,as the comma is the only divider.
A Variable is a text string, so there is no option to determine the middle.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That smart function that @Marc - Devoteam provided should work in the case you want to split each value of that array. But you say you want to split it in the middle. And when you say middle, you mean the middle of the array size? What define "middle" for you?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are correct - I don't want split each value but split values in the middle of the array.
So if array values are: KEY-1, KEY-2, KEY-3, KEY-4 the middle is then comma after KEY-2
and if there is odd number of values e.g. KEY-1, KEY-2, KEY-3, KEY-4, KEY-5 the middle is comma after KEY-3.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.