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 / OnSelect doesn't fire ...
Power Apps
Unanswered

OnSelect doesn't fire when highlighting text

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi everyone, I think I've found a bug in the datacardvalue OnSelect event.

 

For all of my controls I have an OnSelect event that saves the controls value before editing for audit trail purposes:

OnSelect --> UpdateContext({varAuditPreviousValue:DataCardValue16.Text});

 

This code works fine when you click into the cell before deleting and editing, but if you highlight the value text without first clicking into the cell, varAuditPreviousValue stays blank. If you click into the cell first, and then either backspace or highlight the text before editing, everything works as intended.

 

I can instruct the users to always click into the cell first, but that leaves a big gap in terms of audit trail. Can anyone think of a way to force the OnSelect event to fire?

 

Thank you and happy Friday!

 

-Mike

Categories:
I have the same question (0)
  • Cat Schneider Profile Picture
    488 Most Valuable Professional on at

    This might be an insane idea... but what if you put a button (fully transparent) in front of the text box that would make the user have to click "in" the field thus triggering the update context action from the on click event, and set the button visibility equal to (IsBlank(varAuditPreviousValue) && !IsBlank(DataCardValue16.Text)) || IsBlank(DataCardValue16.Text). That way if the field is blank, then there's no need to block prior to getting the previous value, and if it has a value, it's only editable once the variable has been set... I feel like this could work... let me know if you try it and if you're able to get the functionality you were hoping for. 

  • arpost Profile Picture
    466 on at
    Not sure what control you are using in the Form DataCard, but I'm guessing it is a TextInput control. If so, I posted a related issue here displaying the behavior. **Bug with TextInput**: OnSelect not firing when users click/drag to select text (powerplatform.com)

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 431

#2
WarrenBelz Profile Picture

WarrenBelz 360 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 280 Super User 2026 Season 1

Last 30 days Overall leaderboard