I'm trying to create a collection based on user input. The user input string is manipulated and stored inside the SearchText variable.
Currently, I've set two different conditions in the OnChange event of the input text box:
- if the user types "," the string is split in n+1 strings, where n is equal to the number of occurrences of the "," character.
- if the user types ".." the collections stores a range of numbers with a certain criteria (keep in mind that in this case the input will always be in the form of a 7-digit number, with the last digit being 0).
These are the two blocks of codes that are working flawlessly:
If(Find(",",SearchText)>0,
ClearCollect(
FilterRange,
ForAll(
Split(SearchText, ","),
{ Value: Value(ThisRecord.Value) }
)
)
),
and
If(Find("..",SearchText)>0,
ClearCollect(
FilterRange,
Sequence(
(Value(Last(Split(SearchText,"..")).Value)-Value(First(Split(SearchText,"..")).Value))/10 + 1,
Value(First(Split(SearchText,"..")).Value),
10
)
)
);
When I check in the variables panel, the FilterRange collection is storing correctly the input values, as shown in the following screenshots:


Now, I'm trying to implement the possibility to use both "," and ".." at the same time in a single user input. To do this, I've merged the two chunk of codes in the following one:
If(Find(",",SearchText)>0,
ClearCollect(
FilterRange,
ForAll(
Split(SearchText, ","),
If(Find("..",ThisRecord.Value)>0,
Sequence(
(Value(Last(Split(ThisRecord.Value,"..")).Value)-Value(First(Split(ThisRecord.Value,"..")).Value))/10 + 1,
Value(First(Split(ThisRecord.Value,"..")).Value),
10
),
{ Value: Value(ThisRecord.Value) }
)
)
)
),
However, with this code I'm facing a big issue: the FilterRange collection is not being created correctly: if I check it in the variables tab, I can see that it is storing n+1 tables, where n is equal to the number of occurrences of the "," typed in by the user (see image below). Each of these tables contain the input values (or the range of input values if ".." is found at each occurrence).

How can I manage to store correctly only the string values inside the collection? Probably what is causing the issue is the If statement inside the ForAll() function.
Thank you in advance.