Hello Everyone,
I need help on this please i am trying to archive this, i have a form and gallery repeating and i would when user enters Number Package field example 2 on form then the bottom repeating gallery to add 3 blank lines, whats the logic or formula to use please.
here is a screen shot
Thanks
Solved! Go to Solution.
Hi @Ramole ,
Yes, try this. If the text box is not blank, save the value into a variable and create blank records, when the text box is cleared, remove the Last N records based on the variable.
If(IsBlank(DataCardValue60_2.Text),
Remove(NewShipCollection, LastN(NewShipCollection, VarNum)),
Set(VarNum,DataCardValue60_2.Text);ForAll(
FirstN(ColNum,Value(VarNum)),
Collect( NewShipCollection,
{CItemSerialNumber: Text(Last(NewShipCollection).CItemSerialNumber + 1),
Clevel: "",
Ctc: "",
Cdescription: ""
})))
Hope this helps.
Sik
Hi @Ramole ,
Assuming you will have a small number of these, the code for up to three is below - you could extent this as far as you wish - the code will stop when it reaches the number it needs to be greater than.
If(
Value(
YourNumberFieldName.Text
)>0,
Patch(
YourListName,
Defaults(YourListName)
)
);
If(
Value(
YourNumberFieldName.Text
)>1,
Patch(
YourListName,
Defaults(YourListName)
)
);
If(
Value(
YourNumberFieldName.Text
)>2,
Patch(
YourListName,
Defaults(YourListName)
)
)
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 @WarrenBelz
Where should i use that code and all i was looking is when input the text box value in number i would my collection gallery to add create the lines for me, here is my collection formula that adds row or lines
Collect(
NewShipCollection,
{
CItemSerialNumber: Text(Last(NewShipCollection).CItemSerialNumber + 1),
Clevel: "",
Ctc: "",
Cdescription: ""
}
)
Thanks
Hi @Ramole ,'
I simply answered your question for code to produce new lines. You could trigger it from a button or from the OnChange of the number field - that is up to your functional requirements.
Your collection is another question.
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 @WarrenBelz
This is repeating gallery and to add another line or row is doing collection as is not patching is only just adding new rows then i patch ForAll thats fine but on OnChange the field i would to add the reaping gallery rows for so if enter example number 2 i would to pupolate for me two line on gallery, so on so forth,
at moment i have to click button each time i need another line on the gallery and i use that collection on my last post
Thanks
OK @Ramole ,
You could do this - a bit clunky, but just keep adding rows as the numbers increase
If(
Value(
YourNumberFieldName.Text
)>0,
Collect(
NewShipCollection,
{
CItemSerialNumber: Text(Last(NewShipCollection).CItemSerialNumber + 1),
Clevel: "",
Ctc: "",
Cdescription: ""
{
)
)
);
If(
Value(
YourNumberFieldName.Text
)>1,
Collect(
NewShipCollection,
{
CItemSerialNumber: Text(Last(NewShipCollection).CItemSerialNumber + 1),
Clevel: "",
Ctc: "",
Cdescription: ""
{
)
);
If(
Value(
YourNumberFieldName.Text
)>2,
Collect(
NewShipCollection,
{
CItemSerialNumber: Text(Last(NewShipCollection).CItemSerialNumber + 1),
Clevel: "",
Ctc: "",
Cdescription: ""
{
)
)
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 @WarrenBelz
This is the error i get on the screen shot
Thanks
@Ramole ,
I copied your code and simply repeated it three times with the number logic.
I cannot see under the error, but you must have a bracket wrong somewhere.
Hi @Ramole,
Could you please try this?
1. Set App.OnStart: ClearCollect(ColNum,[1,2,3,4,5,6,7,8,9,10]) // asume the maxiumn of Number Package field is 10
2. Modify the OnChange of Number Package Textinput box as below, it creates new rows repeatedly based on the values you enter.
ForAll(
FirstN(ColNum,Value(DataCardValue60_2.Text)),
Collect( NewShipCollection,
{CItemSerialNumber: Text(Last(NewShipCollection).CItemSerialNumber + 1),
Clevel: "",
Ctc: "",
Cdescription: ""
}))
Hope this helps.
Sik
User | Count |
---|---|
255 | |
112 | |
92 | |
48 | |
38 |