Hi Expert!
With the help of you guys, I made this collection, with 3 inputs, "From ID", "To ID" and "Sequence Start":
But when I try to add another sequence, for example, "From ID": 51721456, "To ID": 51721460, "Sequence Start": 16.
is not working....any ideas how to add new a sequence to this collection?
Much appreciated in advance !
@gabibalaban it works fine! I just made a little change
TO : Last(newCollection).TO+2* Value
Just a mistype from your side.
With(
{
iterationCount:Round(Value(TextInput5_3.Text)-Value(TextInput2_3.Text))/2)
},
Collect(newCollection,
ForAll(Sequence(iterationCount),
{
'ID':Value(TextInput2_3.Text)+(Value-1)*,
'FROM': Last(newCollection).TO+2*(Value-1),
'TO': Last(newCollection).FROM+2* Value
}
)
)
HI @gabibalaban ,
almost achieved the scenario, the first part it works with your code (see image 1):
But when I try to add new set of values, the FROM and TO columns, they do not increase by 2 as they should (see image 2), only the ID column works fine.
This is your code that I used, but collecting data instead:
With(
{
iterationCount:Round(Value(TextInput5_3.Text)-Value(TextInput2_3.Text))/2)
},
Collect(newCollection,
ForAll(Sequence(iterationCount),
{
'ID':Value(TextInput2_3.Text)+(Value-1)*1,
'FROM': Last(newCollection).TO+2,
'TO': Last(newCollection).FROM+2
}
)
)
Thanks in advance!!
@Kepcla ,
It is not clear to me if you want to add to existing collection values or to populate the collection with new values. Also I guess that you have somewhere on the screen a button to control the moment when the collection is populated.
The formula in OnSelect property of the button should be:
With(
{
iterationCount:
Round(Value(ToIDTextInput.Text)-Value(FromIDTextInput.Text))/2)
},
ClearCollect(newCollection,
ForAll(Sequence(iterationCount),
{
‘From ID’:Value(FromIDTextInput.Text)+(Value-1)*2,
‘To ID’:(Value-1)*2,
Sequence:Value*2
}
)
)
Hope it helps !
I made a mistake explaining the scenario...The FROM - TO text input box, generate the column "ID"
And "Sequence Start" text input box, generate the column FROM and TO (2 in 2)
I have a button to create the collection, but I can´t collect/add a new sequence below the current collection...
For example, I would enter the new values in the text input boxes, and I should get this, but below the current collection.
I hope you understand the scenario a little better.
Best regards!
WarrenBelz
146,635
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional