I have a string of text that I need to split into "pairs."
DODODODODODODODOUSUSDOUSUSDOUSUSDODOUSUSDOUSUSDODOUSUSDODODODO
So for the outcome I want:
0: DO
1: DO
and so forth....
I'm composing the variable, putting it in a string, and then using a select to break it apart. It is splitting it, but it's returning every other result in backwards order (DO = OD), and they are duplicates, meaning I'm not getting the full string broken down, just 50% of it because every entry repeats.
Select From:
range(0, add(div(length(variables('DailyActivities')), 2), 1))
Map:
substring(variables('DailyActivities'), mul(item(), 1),
if(greater(add(mul(item(), 2), 2), length(variables('DailyActivities'))),
sub(length(variables('DailyActivities')), mul(item(), 2)), 2))
Response:
[
"DO",
"OD",
"DO",
"OD",
"DO",
"OD",
"DO",
"OD",
"DO",
"OD",
"DO",
"OD",
"DO",
"OD",
"DO",
"OU",
"US",
"SU",
"US",
"SD",
"DO",
"OU",
"US",
"SU",
"US",
"SD",
"DO",
"OU",
"US",
"SU",
"US",
""
]
Help please!

