Skip to main content
Community site session details

Community site session details

Session Id : 450p3pW8QHWwyQ/tCbrDkz
Power Apps - Building Power Apps
Answered

Updating issues between Power Apps and SPL

Like (0) ShareShare
ReportReport
Posted on 21 Oct 2023 13:41:17 by

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.

  • Community Power Platform Member Profile Picture
    on 31 Oct 2023 at 00:35:21
    Re: Updating issues between Power Apps and SPL

    Hi @jcfDaniel ,

     

    The issue has been solved. You were right, my OnChange and Gallery code somehow wasn't accurate. Thank you for pointing it out!

  • Verified answer
    jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on 25 Oct 2023 at 06:50:14
    Re: Updating issues between Power Apps and SPL

    What I am saying is that at some point a completed item is changed back to received. This is your issue, right?

     

    You need to find where that happens.

     

    I would take a look at that on change on the dropdown. The filter on the order datetime seems thin.

  • Community Power Platform Member Profile Picture
    on 24 Oct 2023 at 08:55:24
    Re: Updating issues between Power Apps and SPL

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

  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on 24 Oct 2023 at 08:00:31
    Re: Updating issues between Power Apps and SPL

    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
    on 24 Oct 2023 at 07:56:57
    Re: Updating issues between Power Apps and SPL

    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 24 Oct 2023 at 07:51:22
    Re: Updating issues between Power Apps and SPL

    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
    on 24 Oct 2023 at 07:40:05
    Re: Updating issues between Power Apps and SPL

    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 24 Oct 2023 at 07:37:57
    Re: Updating issues between Power Apps and SPL

    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
    on 23 Oct 2023 at 07:03:17
    Re: Updating issues between Power Apps and SPL

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

  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on 23 Oct 2023 at 06:47:36
    Re: Updating issues between Power Apps and SPL

    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.

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473