Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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 365

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. 

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard