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 form ...
Power Apps
Unanswered

Model Driven app form control fill using javascript webresource

(0) ShareShare
ReportReport
Posted on by 50

I am converting nintex form to Power model driven apps,  i am trying to use the javascript if fil the color of control.

 

function BillingGridContractRate(executionContext) {

 

var formContext = executionContext.getFormContext();

var ContractRate= formContext.getAttribute("corampb_contractrate").getValue();

if(ContractRate=true)

{

    alert("yellow");

    formContext.getAttribute("corampb_contractrate").style.backgroundColor="Yellow";

 

}

else

{

    alert("gray");

    formContext.getAttribute("corampb_contractrate").style.backgroundColor="Gray";} 

}

 

Error: Cannot set properties of undefined (setting 'backgroundColor')

 

 

Categories:

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard