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

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Unexpected behaviour f...
Power Apps
Unanswered

Unexpected behaviour for Select() method, is it async?

(1) ShareShare
ReportReport
Posted on by 124
​Hi all,
 
I have two buttons, the first one named btnChassisRow with the following OnSelect:
 
If(
    rightClickListener1.isPressed;
    UpdateContext({ctxDoubleClicked: true});
    If(
        "Control" in Split(
            pressedKeys1.pressedKeys;
            ", "
        );
        Select(cbSelectedRow);;
        UpdateContext({ctxSelectedVehicle: ThisItem});;
        ;
        UpdateContext({ctxClicked: !ctxClicked});;
        If(
            !ctxClicked And ctxStarted And ctxSelectedVehicle.Chassis = ThisItem.Chassis;
            UpdateContext({ctxDoubleClicked: true});;
            ;
            UpdateContext(
                {
                    ctxDoubleClicked: false;
                    ctxSelectedLocation: Blank()
                }
            );;
        );;
        UpdateContext({ctxSelectedVehicle: ThisItem});;
        Reset(timerHoldForDetails);;
        UpdateContext(
            {
                ctxDisplayVehicleMoves: false;
                ctxDisplayEditVehicle: false
            }
        );;
        Copy(Self.Text);;
    );;
    
);;
 
The second one has the following OnSelect:
 
Select(btnChassisRow);;
Copy(Self.Text);;
 
The expected behaviour would be to first Copy() the Text property of btnChassisRow, then replace the copied content with the Copy() from the second button.
However, I end up having the btnChassisRow's Text in my clipboard after selecting the second button
 
Categories:
I have the same question (0)
  • KeithAtherton Profile Picture
    3,705 Most Valuable Professional on at
    Unexpected behavior for Select() method, is it async?
    Hey. I would also expect the behaviour that you mention.
     
    If you change the second button code rom this:
    Copy(Self.Text);;
    To this:
    Copy(btnSecondButton.Text);;
     
    Does it behave any differently?
  • BaptisteW Profile Picture
    124 on at
    Unexpected behavior for Select() method, is it async?
    Sadly no.

    I fixed it in my app by introducing a new variable

    1st button
    If(
        !ctxPreventCopyChassis;
        Copy(Self.Text)
    );;


    2nd button
    UpdateContext({ctxPreventCopyChassis: true});;
    Select(btnChassisRow);;
    Copy(Self.Text);;
    UpdateContext({ctxPreventCopyChassis: false});;

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 836 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 231 Super User 2025 Season 2

Last 30 days Overall leaderboard