Hi All,
I have an issue which I cannot get my head around. I have two SPO lists, Orders & ItemsInOrder. I have a "shopping cart" system, whereby I create orders in one list, but the items themselves are in the second list and are referenced to an Order ID.
I am able to update the status of each item independently (each item can be marked as "on hold", "declined" etc) and this works well. What I am wanting to do is have the system patch the Order to the same status if all of the items are marked the same, so for example if all items are marked "on hold" the Order itself will be marked as on hold. I have two galleries, the first one is the gallery of orders and the second is those items linked to that order. Can anyone advise of how I could do this? I use a variable to set the selected Order for patching.
My patch for the OrderItems is: ForAll(Gallery7.AllItems,Patch(ItemsInOrder,{ID:ID},{ItemInOrderStatus:Dropdown2.Selected.Value}))
Thanks,
Chris
Solved! Go to Solution.
Hi @Anonymous ,
Could you please share a bit more about your scenario?
Could you please show more details about the variable that you mentioned? Could you please share more details about the formula you used within the Items property of the second Gallery? Does the Gallery7 represent the second Gallery?
Based on the formula you provided, I think you use this Patch formula to update the Order Items status in your second Gallery (Gallery7), is it true?
Based on the needs that you mentioned, I think a Timer control could achieve your needs. I have made a test on my side, please take a try with the following workaround:
Add a Timer control in your app, set the Duration property to following:
1000
set the AutoStart and Repeat property to following:
true
set the OnTimerEnd property of the Timer to following:
If( CountRows(Filter(Gallery7.AllItems, ItemInOrderStatus = First(Gallery7.AllItems).ItemInOrderStatus)) = CountRows(Gallery7.AllItems),
Patch(
'Orders List',
FirstGallery.Selected, /* or type LookUp('Orders List', ID = FirstGallery.Selected.ID) */
{
OrderStatus: First(Gallery7.AllItems).ItemInOrderStatus /* <-- OrderStatus represents the Status column in your Orders List, which is used to store the status value */
}
) )
Note: The FirstGallery represents the first Gallery in your app, which connects to the Orders SP List.
If the OrderStatus column in your Orders List is Choice type column, please consider modify above formula as below:
If( CountRows(Filter(Gallery7.AllItems, ItemInOrderStatus = First(Gallery7.AllItems).ItemInOrderStatus)) = CountRows(Gallery7.AllItems),
Patch(
'Orders List',
FirstGallery.Selected, /* or type LookUp('Orders List', ID = FirstGallery.Selected.ID) */
{
OrderStatus: {
Value: First(Gallery7.AllItems).ItemInOrderStatus
}
}
) )
Set the Visible proeprty of the Timer to following:
false
Please consider take a try with above solution, check if the issue is solved.
Best regards,
Hi @Anonymous ,
Could you please share a bit more about your scenario?
Could you please show more details about the variable that you mentioned? Could you please share more details about the formula you used within the Items property of the second Gallery? Does the Gallery7 represent the second Gallery?
Based on the formula you provided, I think you use this Patch formula to update the Order Items status in your second Gallery (Gallery7), is it true?
Based on the needs that you mentioned, I think a Timer control could achieve your needs. I have made a test on my side, please take a try with the following workaround:
Add a Timer control in your app, set the Duration property to following:
1000
set the AutoStart and Repeat property to following:
true
set the OnTimerEnd property of the Timer to following:
If( CountRows(Filter(Gallery7.AllItems, ItemInOrderStatus = First(Gallery7.AllItems).ItemInOrderStatus)) = CountRows(Gallery7.AllItems),
Patch(
'Orders List',
FirstGallery.Selected, /* or type LookUp('Orders List', ID = FirstGallery.Selected.ID) */
{
OrderStatus: First(Gallery7.AllItems).ItemInOrderStatus /* <-- OrderStatus represents the Status column in your Orders List, which is used to store the status value */
}
) )
Note: The FirstGallery represents the first Gallery in your app, which connects to the Orders SP List.
If the OrderStatus column in your Orders List is Choice type column, please consider modify above formula as below:
If( CountRows(Filter(Gallery7.AllItems, ItemInOrderStatus = First(Gallery7.AllItems).ItemInOrderStatus)) = CountRows(Gallery7.AllItems),
Patch(
'Orders List',
FirstGallery.Selected, /* or type LookUp('Orders List', ID = FirstGallery.Selected.ID) */
{
OrderStatus: {
Value: First(Gallery7.AllItems).ItemInOrderStatus
}
}
) )
Set the Visible proeprty of the Timer to following:
false
Please consider take a try with above solution, check if the issue is solved.
Best regards,
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
199 | |
71 | |
50 | |
43 | |
30 |
User | Count |
---|---|
256 | |
126 | |
87 | |
84 | |
82 |