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 Pages / Dynamically Change log...
Power Pages
Answered

Dynamically Change logo in Power Apps Portal

(0) ShareShare
ReportReport
Posted on by 26

Hi Experts - We are developing Power Apps Portal for B2B customer and having a requirement to display customer specific logo in portal for every B2B customer login. Can you please suggest, how dynamically we can achieve this requirement ?

 

Thanks

Pankaj

Categories:
I have the same question (0)
  • João Santos Profile Picture
    323 on at

    Hi,

    I'm guessing you are using the account - contact relationship so you should be able to configure the image/logo field on the account and then display that field as an img component on the portal based on who's logged in. Have a look at this on how to do it: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/image-attributes

     

    Hope that helps

  • pankaj1138 Profile Picture
    26 on at

    Hi , Issue is not with storing the logos ... we can store it in web files inside portal management app as well. question is here, where we need to write the logic to fetch the images and show in portal header left side dynamically.

     

    Thanks 

    Pankaj

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @pankaj1138 

     

    Once you upload the image as a web file. 

    In the portal management app: 

     

    1. Under content> web templates > look for "Header" 

    2. Choose the appropriate website 

     

    ragavanrajan_0-1664008110059.png

     

    You can use a liquid templating language using user object 

     

    official URL: click here  

     

    you can also mix and match liquid and JS together and the page > localised content > custom JS 

     

    Sample below. The idea here is if the user belongs to a specific web role (company) then you can display logo dynamically based on the web role. 

     

    $(document).ready(function () {
     var roles = "{{ user.roles }}";
     console.log(roles);
     if(roles.contains("Administrators") > 0)
     alert("I am Admin");
    });
    

     

    Hope it helps. 
    ------------

    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

  • GauravPandey Profile Picture
    19 on at

    Hi Pankaj,

    There is a content snippet 'Mobile Header' that loads image in the portals by default.

    You can update the Header template as suggested by Raghav with your logic to update the image dynamically.

    You can 

    1) create web files with different brand image attached as notes.

    2) create html content snippets per brand and refer the image there.

    3) Lastly in the Header you can use the liquid if else to include your snippets according to your condition.

    {% if user.roles contains 'Role1'%}

    {% editable snippets "Brand1" %}

    {% elif user.roles contains 'Role2'%}

    {% editable snippets "Brand2" %}

    {% elif user.roles contains 'Role3'%}

    {% editable snippets "Brand3" %}

    {% endif %}

     

  • Verified answer
    GauravPandey Profile Picture
    19 on at

    You can add the above logic in the Header within the highlighted div

    GauravPandey_0-1664034997205.png

     

  • pankaj1138 Profile Picture
    26 on at

    Thanks @GauravPandey , this worked.

  • GauravPandey Profile Picture
    19 on at

    Cheers!

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 Pages

#1
Fubar Profile Picture

Fubar 78 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard