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 / Model Driven App: When...
Power Apps
Unanswered

Model Driven App: When user Select Approve in a Choice Column Populate Diffrent Column with Current user and Time and Data.

(1) ShareShare
ReportReport
Posted on by 395

I am new to Model Driven Apps. I am trying to Set a field value with the current username when that user Selects Approve on a Choice Column. The research i have done says the only way to do that is to use JavaScript. This is what I have so far after using Copilot:

function GetCurrentUserOnChange(){
var dropdownValue = Xrm.Page.getAttribute("car_BryceCompanyApproval1").getValue();

if (dropdownValue === "Approve") { 
 var currentUserName = Xrm.Utility.getGlobalContext().userSettings.userName;
 var message = currentUserName + "Date and Time";

 Xrm.Page.getAttribute("car_BryceCompany_1_ApproveBy").setValue(message);
}
}

Xrm.Page.data.entity.addOnLoad(hideSectionIfFieldEmpty);

  I am not sure if this is the best way to do it. And i am not sure how to get it working with in my form. 

 

Any help would be welcomed. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard