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 / Multiple icons in mode...
Power Apps
Unanswered

Multiple icons in model-drive view

(0) ShareShare
ReportReport
Posted on by 26

Hi 

I followed this example to implement icons in a column of a table view. However, it's only working on one column - I need it on two columns. Anyone done this successfully? Thanks.    

I have the same question (0)
  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hello @Dartanian,

     

    As per your image, i think there is some issue in the Switch case while populating the image in the view.

     

    Please find my Video with step by step Guidance : https://www.youtube.com/watch?v=xLL0YZc8m1Y&t=2s

     

    And my blog for Coding too : https://microsoftcrmtechie.blogspot.com/2021/09/add-custom-icons-in-sub-grid-or-view-in.html

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

  • Dartanian Profile Picture
    26 on at

    Thanks @rampprakash   

    Actually, I watched your excellent video when I worked on the scrip. Very helpful, thank you 😀 . The problem is how to take a script that works and make it work for 2 columns. 

    I have one .js script that has two function. 

    Switch case for function 1: 
    switch (flagduedate) {  
            case "Late!":  
                imgName = "rock_redicon";  
                tooltip = "Red"
                break;  
            case "Due soon":  
                imgName = "rock_ambericon";
                tooltip = "Amber"  
                break;  
            case "On time!":  
                imgName = "rock_greenicon";  
                tooltip = "Green"
                break;  
            default:  
                imgName = "";  
                tooltip = "";  
                break;  
        }  
        var resultarray = [imgName, tooltip];  
        return resultarray;  

     

    Switch case for function 2: 

    switch (flagfirmsrag) {  
            case "High risk":  
                imgName = "rock_redicon";  
                tooltip = "Red"
                break;  
            case "Mid risk":  
                imgName = "rock_ambericon";
                tooltip = "Amber"  
                break;  
            case "Low risk":  
                imgName = "rock_greenicon";  
                tooltip = "Green"
                break;  
            default:  
                imgName = "";  
                tooltip = "";  
                break;  
        }  
        var resultarray = [imgName, tooltip];  
        return resultarray;
     
    The weird thing is that when I go back to the classic interface, sometimes the name of the script has reverted to the earlier version which only has one function. I'll try using Edge in case Chrome is an issue. 
  • Dartanian Profile Picture
    26 on at

    Same with Edge. I attach the script to the column properties for both columns, but when I go back into the settings it has gone from the second column. Is the platform detecting a clash between the two functions running on the same view page? Would it be able to automatically ditch the script from a column?     

  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hello @Dartanian,

     

    Its Simple 

     

    1. Create a Function for One Column and Call that function in One View (Function1)

    2. Create another Function in the Same Library and Call that Function in another View (Function2)

     

    So 2 Function for 2 Views 

     

    Just Pass the Logical Name Column inside the Function like below 

     

    rampprakash_0-1640886072363.png

     

    Please let me know if you need any help

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

     

  • Dartanian Profile Picture
    26 on at

    Are you saying there can't be more than one column with icons per view? 

  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hello @Dartanian,

     

    Nope, it is possible but the Function trigger should be different for each Columns

     

    First Column as per your snapshot

     

    In code : var currentRows = getRows.Field1LogicalName

    rampprakash_0-1640895225792.png

    Second Column : (For Example)

     

    Function Name : ChangeIconTooltip

    In code : var currentRows = getRows.Field2LogicalName

     

    Give a private chat if u need more help 🙂

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

  • Dartanian Profile Picture
    26 on at

    Hi @rampprakash 

    I think that's what I've already got. Are you available now for chat? 

  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hello @Dartanian,

     

    yes we can, please give a private chat

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard