Hi all,
in my ordering system, on admin screen where admin is responsible in updating order progress, I used a gallery to show a list of order, a timer to auto update my data source in SPL and a dropdown control with three values (Order Received, In Preparation, Delivery) to update the order progress. And it is users' responsibilities to set their order to Completed by clicking on a button.
I have a filter in my gallery where once orders are set to Delivery, it will disappear from admin view. And once the order is set to Completed by users, the order also will disappear from users' view.
Admin's view.

User's view:

However, I encountered a problem where seconds after order with Delivery disappear from this view, it will return back to this view but with Order Received status. Before this, it works just fine.
Here's what I have configured so far on admin view:
Gallery's Item property:
With(
{
orderSeq: SortByColumns(
Filter(
'Order Summary',
OrderStatus.Value <> "Completed" && OrderStatus.Value <> "Delivery"
),// Exclude 'Completed' (internal value 2) orders
"DateTime",
SortOrder.Ascending
)
},
ForAll(
Sequence(CountRows(orderSeq)),
Patch(
Index(
orderSeq,
Value
),
{RowNo: Value}
)
)
)
Timer:
- Duration: 5000ms
- Repeat = true
- AutoStart = true
- AutoPause = true
- OnTimerEnd = Refresh('Order Summary')
Dropdown control:
Patch(
'Order Summary',
LookUp('Order Summary', OrderDateTime = Gallery3.Selected.OrderDateTime),
// Update the OrderStatus field
{OrderStatus: {Value: Dropdown2.Selected.Value}}
);
If(Text(ThisItem.OrderStatus.Value) = "Delivery", DisplayMode.Disabled, DisplayMode.Edit);
Notify("Status updated.", NotificationType.Success)
Text(ThisItem.OrderStatus.Value)
And this is what I put and configured on user's button to set their order progress to Completed:
Patch(
'Order Summary',
LookUp(
'Order Summary',
ID = Gallery2_1.Selected.ID
),
// Update the OrderStatus field
{OrderStatus: {Value: "Completed"}}
);
Notify("Order completed.",NotificationType.Success);
UpdateContext({varConfirmCompleted:false})
Please help me to find the root cause to this issue.