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

Notifications

Announcements

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

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard