Hi,
I would to update / patch Inventory quantity field using ForAll when submitting data, but at moment i am using a single record, but i would like to update all items in the gallery in collection and update each quantity field please help, here the formula i am using at moment.
UpdateIf(
ProductServiceList,
Title = Gallery5.Selected.SKU,
{'Quantity On Hand': 'Quantity On Hand' - Value(DDAmountCart.Selected.Value)}
)
Thanks
Solved! Go to Solution.
@Ramole ,
See what you are doing different here - I even named all the elements the same
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.
@fugixi ,
I have found the Patch "lining up" columns unreliable if you have matching columns (but the columns do not match here ) so a ForAll() should be an easier solution. Also your Patch syntax should be
Patch(
CartList,
{Title:ThisItem.SKU},
{'Quantity On Hand': 'Quantity On Hand' - Value(DDAmountCart.Selected.Value)}
)
@Ramole ,
Assuming you have a field in a collection patched when you change the dd
ForAll(
GalleryName.AllItems As aGall,
Patch(
ProductServiceList,
{ID:aGall.ID},
{'Quantity On Hand': 'Quantity On Hand'- aGall.DDCartFieldName}
)
)
The ID can be any unique record identifier.
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
I am getting error on 'Quantity On Hand', see the screenshot please, @WarrenBelz i update quantity when submitting the data at end Not onChange
Thanks
@Ramole ,
Try this
ForAll(
Gallery5.AllItems As aGall,
Patch(
ProductServiceList,
{Title:aGall.SKU},
{
'Quantity On Hand': aGall.'Quantity On Hand' -
Value(aGall.DDAmountCart.Selected.Value)
}
)
)
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
Still same error, let explain what i am doing is i collect items from a list called product to cartlist collection then after that i would like CartList collection to submit but before i do that i want to deduct all the quantities in cartlist from product list, here the formula for my collection.
Collect(
CartList,
{
ID: Concatenate(
Text(
Now(),
"[$-en-US]mm/dd/yyyy hh:mm:ss"
),
First(ProductInfoCollection).Title,
Text(DDAmount.Selected.Value)
),
Name: First(ProductInfoCollection).'Sales Description',
SKU: First(ProductInfoCollection).Title,
Amount: DDAmount.Selected.Value,
Price: First(ProductInfoCollection).'Sales Price / Rate',
CATEGORY: First(ProductInfoCollection).CATEGORY,
Image: First(ProductInfoCollection).ImageLink,
Qty: First(ProductInfoCollection).'Quantity On Hand',
Total: (DDAmount.Selected.Value * First(ProductInfoCollection).'Sales Price / Rate')
}
);
UpdateContext({ResetDDAmount: true});
UpdateContext({ResetDDAmount: false});
Navigate(Home);
Thanks
@Ramole ,
I have that syntax working on a test list here (hence the enhancement when I was able to test it properly).
Your current post is another subject entirely - can we please stick to the posted subject and apply the values as they relate to your model.
Hi @WarrenBelz
the post is before adding to collections to check the how many quantities available or else disable if the input more than availability’
thanks
@Ramole ,
What error are you getting on your code - please also post it in Text.
Hi @WarrenBelz
Same error 'Quantity On Hand' not exist
@Ramole ,
Please post your code as Text as requested - I have the syntax working perfectly here.
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
267 | |
222 | |
76 | |
38 | |
36 |
User | Count |
---|---|
338 | |
224 | |
123 | |
71 | |
56 |