I have this code:
ClearCollect(
colText1;
ForAll(
Split(TextInput1.Text; Char(10));
{
Text1: Result
})
)
It works great. It takes all values from textinput1 and create a collection, one row for each new row in the textinput box.
But now i want to duplicate this code and at the same time add data from another textinput.
So i did this:
Clear(colText1);;
ClearCollect(
colText1;
ForAll(
Split(TextInput1.Text; Char(10));
{
Text1: Result
});
ForAll(
Split(TextInput1_1.Text; Char(10));
{
Text2: Result
})
)
But then the collection looks like this.
This is not the result i am after. I want them to be side by side. So i can with one button collect several textinputs to one collection and keep the order that the textinputs have.
Solved! Go to Solution.
Hi @Oskarkuus ,
This is not nearly as easy as you might think and I answered a similar question a week or so ago and ended up writing a blog on it. Note I have free-typed this, so you might have to clean up commas/brackets etc, but the structure you need is below
Clear(colText1);;
With(
{
wList:
ForAll(
Split(
TextInput1.Text;
Char(10)
);
{Text1: Result}
)
};
Collect(
colText1;
Patch(
Last(
FirstN(
wList;
Value
)
);
{RowNo1: Value}
)
)
);;
Clear(colText2);;
With(
{
wList:
ForAll(
Split(
TextInput1_1.Text;
Char(10)
);
{Text2: Result}
)
};
Collect(
colText2;
Patch(
Last(
FirstN(
wList;
Value
)
);
{RowNo2: Value}
)
)
);;
Clear(colText3);;
Collect(
colText3;
AddColumns(
colText1;
"Text2";
LookUp(
colText2;
RowNo2 = RowNo1
).Text2
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @Oskarkuus ,
This is not nearly as easy as you might think and I answered a similar question a week or so ago and ended up writing a blog on it. Note I have free-typed this, so you might have to clean up commas/brackets etc, but the structure you need is below
Clear(colText1);;
With(
{
wList:
ForAll(
Split(
TextInput1.Text;
Char(10)
);
{Text1: Result}
)
};
Collect(
colText1;
Patch(
Last(
FirstN(
wList;
Value
)
);
{RowNo1: Value}
)
)
);;
Clear(colText2);;
With(
{
wList:
ForAll(
Split(
TextInput1_1.Text;
Char(10)
);
{Text2: Result}
)
};
Collect(
colText2;
Patch(
Last(
FirstN(
wList;
Value
)
);
{RowNo2: Value}
)
)
);;
Clear(colText3);;
Collect(
colText3;
AddColumns(
colText1;
"Text2";
LookUp(
colText2;
RowNo2 = RowNo1
).Text2
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
User | Count |
---|---|
258 | |
109 | |
95 | |
57 | |
40 |