web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Updating issues betwee...
Power Apps
Answered

Updating issues between Power Apps and SPL

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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. 

AmiraRoslan_0-1697894669602.png

User's view:

AmiraRoslan_1-1697895465142.png

 

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:

  • OnChange

 

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)

 

  • Default

 

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.

Categories:
  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    Hi,

     

    This is the only piece of code that updates order statuses?

     

    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)

     

    regards.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @jcfDaniel , thank you for responding. 

    Yes, on admin side, that's the only code to update order progress. I also put a timer to auto refresh the Order Summary data source. 

  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    You say that items are brought back to Order Received status, right? So do these items ever make their way to the user's view?

     

    Regards.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yes, to both questions. Even when the order is set to Completed. 

  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    So the current flow brings an item from Received through completed and then back to received, right? Can you share the code that creates the item in the first place?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Dropdown Items:

    Filter(Choices('Order Summary'.OrderStatus), Value <> "Completed")

     

    Gallery Items:

    With(
     {
     orderSeq: SortByColumns(
     Filter(
     'Order Summary',
     OrderStatus.Value = "Order Received" || OrderStatus.Value = "In Preparation"
     ),// Exclude 'Completed' (internal value 2) orders
     "DateTime",
     SortOrder.Ascending
     )
     },
     ForAll(
     Sequence(CountRows(orderSeq)),
     Patch(
     Index(
     orderSeq,
     Value
     ),
     {RowNo: Value}
     )
     )
    )
  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    I can see that you changed the filter on statuses.

     

    Still, that's not what creates the order, that picks up orders and gives them a number for processing.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    For dropdown, I only want to show Order Received, In Preparation and Delivery, That's why I filtered the dropdown items. And for gallery, I only want to show orders with Order Received and In Preparation only. 

  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    That looks fine.

     

    You need to find where are your completed items being picked up and patched back to Received.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I dont understand why would I need to patch back the Completed items to Received? I'm sorry, I'm so lost right now. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard