I've been working on an inventory app, and I've encountered a small item I need help tweaking.
The quantity box Stays blank until you start using the arrows, then it starts at 0 and counts up or down. The save button will only submit what the up or down buttons have input. So if i push up 4 times, the number in the box would be 4, but if I type 9 then hit save, 4 is what would be saved. My code is below.
Quantity Text Box= Default : currentQuantityValue
Up Arrow= OnSelect: UpdateContext({currentQuantityValue:currentQuantityValue+1})
Down Arrow= Onselect: UpdateContext({currentQuantityValue:currentQuantityValue-1})
Save Button= OnSelect:
Patch(PadPartsList, Gallery1_1.Selected, {Quantity:currentQuantityValue});
ResetForm(Form1_1);
Navigate(EPList)
Form Text Box:
Any Tips would be greatly appreciated. I'm sure It's something about how I have the variable assigned or something. But I'm stumped at the moment.
Don't reference the variable in your patch, reference the textinput control.
Patch(PadPartsList,
Gallery1_1.Selected,
{Quantity: Value(yourQuantityTextboxName.Text)}
);
I hope this is helpful for you.
When I tried that, the Up and Down buttons no longer work and the patch function does not update the quantity at all.
I did try changing the control on the up and down buttons from UpdateContext({currentQuantityValue:currentQuantityValue-1}) to UpdateContext({TextInput3.Text:currentQuantityValue-1}) and also UpdateContext({currentQuantityValue:TextInput3.Text-1}) with no luck.
Set OnChange property of your text input control to:
UpdateContext({ currentQuantityValue: TextInput3.Text })
Please click Accept as solution if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it 👍
User | Count |
---|---|
157 | |
93 | |
78 | |
73 | |
57 |
User | Count |
---|---|
202 | |
166 | |
98 | |
94 | |
79 |