Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
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.

 

  • Verified answer
    EricRegnier Profile Picture
    8,714 Most Valuable Professional on at
    Re: Problems with displaying custom icons alongside values in active projects list

    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!

  • SteveYao Profile Picture
    on at
    Re: Problems with displaying custom icons alongside values in active projects list

    Hi @PPMFan 

     

    Do you have seen any error message?

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 17

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics