I have a Gallery containing items from a SharePoint list that you can check. When they are checked, the input comes up to add a quantity. You can check multiple items and set a quantity for each. See screenshot below.
The code for the checkbox and text input are as follows for the different aspects.
Checkbox
OnCheck:
true;Set(ResetAllCheckboxes,false);Collect(CheckedItems,{
Item:Checkbox1.Text,
Quantity: 0,
Price: Text(ThisItem.Price,"[$-en-US]$ ###.00")
})
OnUncheck:
false;
Remove(AllItems,First(Filter(CheckedItems,Item=Checkbox1.Text)));
Remove(CheckedItems,First(Filter(CheckedItems,Item=Checkbox1.Text)));
Set(_reset,true)
Reset:
ResetAllCheckboxes
Text Input:
Default: ""
OnChange:
Set(_reset,false);
UpdateIf(CheckedItems,Item=Checkbox1.Text,{
Quantity:Value(TextInput1.Text)
})
Reset:
_reset
Now, for some reason, when unchecking any item, it resets all of the text input boxes. See screenshot.
Any assistance would be greatly appreciated!
@RandyHayes - You've always been a huge help. Figured I'd tag you.
Solved! Go to Solution.
I fixed it!
Instead of using a _reset variable, I used the Reset function on the Uncheck property of the checkbox.
Reset(TextInput1)
That worked like a charm.
Thanks for your help, Randy!
So the big question is...what is the Default property of the Text box?? That will govern what is shown in it.
""
So I'm guessing I need to adjust that be a dynamic value?
Just not sure what that value should be...
I tried just having it blank, but no dice.
I also tried moving the DisplayMode change to the checkbox OnCheck/Uncheck properties from the input visibility property. Still no dice.
I fixed it!
Instead of using a _reset variable, I used the Reset function on the Uncheck property of the checkbox.
Reset(TextInput1)
That worked like a charm.
Thanks for your help, Randy!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
202 | |
98 | |
60 | |
56 | |
52 |
User | Count |
---|---|
257 | |
161 | |
87 | |
79 | |
68 |