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 / OnChange is executed b...
Power Apps
Unanswered

OnChange is executed before the Items property in the dropdown is changed?

(1) ShareShare
ReportReport
Posted on by 255

Hi, 

I make app, that have several dropdown clasic controlers. 1. controler is "Request", 2. controler is "Order". Order items of dropdown depends on the selection in the Request. 

In item's property of Order I have this code:

SortByColumns(
    (Filter(
        Orders;
        new_Customer.Name = cmbox_request.Selected.Customer.Name;
       
        Zahájení <= datp_datum_pozadavky_3.SelectedDate;
        Ukončení >= datp_datum_pozadavky_3.SelectedDate
    ));
    "new_priorita";
    SortOrder.Descending
)
------------------------------------------
In OnChange property of Order dropdown: 
If(
        IsBlank(
            LookUp(
                colGridUpdates;
                Aktivita = ThisItem.Aktivita
            )
        );
        Collect(
            colGridUpdates;
            ThisItem
        );;
    );;

UpdateIf(
        colGridUpdates;
        Aktivita = ThisItem.Aktivita;
        {
            Order: drp_order_lookup.Selected
        }

)
;;
Select(ButtonCanvas1_3) - this button make the same as the code above
 
--------------------------------------------------
AllowEmptySelection property is false 
 
 
OnChange fungction should modify colGridUpdate table with correct value. But:
Before changing Request (Požadavek):
TomasG_0-1719994798087.png

After changing Request (1.) -> it set to Order correct selectedItem. But into colGridUpdate table it takes/set old value of dropdown Order. 

TomasG_1-1719994916437.png


So my question is. OnChange function starts before changing Items property? 

Can I change it so that it first changes the Items property and pulls/sets the value displayed in green to colGridUpdate using the OnChange function?

When I enable AllowEmptySelection, after changing Request, the Order dropdown is empty - the user must select a value.

Thanks for any advices

Categories:
I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard