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 / Problems with displayi...
Power Apps
Answered

Problems with displaying custom icons alongside values in active projects list

(0) ShareShare
ReportReport
Posted on by 3

I am trying to build a project portfolio model driven app. In the list of Active projects I would like a status icon next to the Overall status of the project.

activeprojectsproblem.png

 

I have tried to follow these instructions.

Since I am not a programmer I have a hard time to understand how to customize the javascript properly to suit my needs. I have uploaded the images as web resources and put in the javascript as an own web resource. I have a option field called Overall status in the Project entity that holds the different statuses: On plan, At risk and Critical. I am not sure on how to correctly reference this entity / field in the javascript and I suspect that is why I am getting an error message when trying to modify the View. 

 

dynamicstull.png

 

Here is the javascript:

 

function displayIconTooltip(rowData, userLCID) {
var str = JSON.parse(rowData);
var coldata = str_overallstatus_Value;
var imgName = "";
var tooltip = "";
switch (parseInt(coldata,10)) {
case 1:
imgName = "onplan";
switch (userLCID) {
case 1036:
tooltip = "The initative is on plan";
break;
default:
tooltip = "The initative is on plan";
break;
}
break;
case 2:
imgName = "atrisk";
switch (userLCID) {
case 1036:
tooltip = "The initative is at risk";
break;
default:
tooltip = "The initative is at risk";
break;
}
break;
case 3:
imgName = "critical";
switch (userLCID) {
case 1036:
tooltip = "The initative is in critical state";
break;
default:
tooltip = "The initative is in critical state";
break;
}
break;
default:
imgName = "";
tooltip = "";
break;
}
var resultarray = [imgName, tooltip];
return resultarray;
}

 

I don't know of any way to get any more specific error message on what is going wrong. Any help is greatly appreciated.

 

I have the same question (0)
  • SteveYao Profile Picture
    Microsoft Employee on at

    Hi @PPMFan 

     

    Do you have seen any error message?

  • Verified answer
    EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi, there are few issues with your JavaScript, I've listed them below as well as things to double check. Below is a simplified version without the multi-language support.

     

    1. Line 3 had underscore instead of decimal: str.overallstatus_Value and not str_overallstatus_Value
    2. Is overallstatus a custom optionset field? If so, you're missing the publisher prefix in front of the name. Default prefix if not change is "new" or "cr_XYZ"
    3. In the "case 1:", "case 2:", "case 3:", make sure the value is the exact value of the optionset. Usually it is a much higher number, like "100000001".
    4. The "imgName" value is also missing the publisher prefix. I added "new_" as an example, but must be set to the correct one.
    5. If the image web resources where added with a folder path (e.g. new_/images/image.png") then you need to include path with the image name. 
    function displayIconTooltip(rowData, userLCID) { 
     var str = JSON.parse(rowData); 
     var coldata = str.overallstatus_Value;
     var imgName = ""; 
     var tooltip = ""; 
     switch (parseInt(coldata,10)) { 
     case 1: 
     imgName = "new_onplan";
     tooltip = "The initative is on plan"; 
     break; 
     case 2: 
     imgName = "new_atrisk"; 
     tooltip = "The initative is at risk"; 
     break; 
     case 3: 
     imgName = "new_critical"; 
     tooltip = "The initative is in critical state"; 
     break; 
     default: 
     imgName = ""; 
     tooltip = ""; 
     break; 
     } 
     var resultarray = [imgName, tooltip]; 
     return resultarray; 
    }

     

    Hope this helps!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard