Dynamically Change the Portal Logo based on Logged In User\’s Account

Hello Everyone,

There might be a requirement for your client to change the Portal Logo based on the different user\’s account.

For Example – If the Logged In User\’s Account is Twitter, He/she should be able to see the Twitter logo on the Portal, same for Chrome and Android Account\’s Users.

Here is the code, I have written for above example:

Before writing this code, I have already been uploaded the images in web files.

<img alt=\”\” id=\”logoId\” style=\”width: 60px; height: 40px;\” src=\”/Handshake_Emoji_Icon_ios10.png\” /> Arpit\’s Dynamics CRM Blog

<script src=\”https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js\”>

  changeLogo();

  function changeLogo() {

    // get Logged In User\’s account name
    var loggedInuseraccount = \’{{user.parentcustomerid.Name}}\’;

     // can get Logged In User\’s name, if you want to change logo based on user name
    var loggedInuseraccount = \’{{user.fullname}}\’;

    if (loggedInuseraccount == \’Chrome\’) {

      $(\”#logoId\”).attr(\”src\”, \”/chrome\”);

    }

    if (loggedInuseraccount == \’Twitter\’) {

      $(\”#logoId\”).attr(\”src\”, \”/twitter\”);

    }
    if (loggedInuseraccount == \’Android\’) {

      $(\”#logoId\”).attr(\”src\”, \”/android\”);

    }

  }

Paste this code inside \’Navbar Left\’ Content Snippet.

Navigate to- Portals > Open \’Navbar Left\’ Content Snippet > Paste above code under \’Value(HTML)\’








Demo :

For Android Account\’s Portal Users

For Chrome Account\’s Portal Users

For Twitter Account\’s Portal Users


Cheers 😎

Published by arpitpowerguide

My name is Arpit Shrivastava, who is a Microsoft MVP in the Business Applications category. I am a Microsoft Dynamics 365 and Power Platform enthusiast person who is having a passion for researching and learning new things and acquiring immense knowledge. I am providing consistent help, support, and sharing my knowledge through various Social Media Channels along with my Personal Blog, Microsoft Community, conducting online training and attending various 365 Saturday Events worldwide and sharing the best Solutions to the readers helping them achieve their goals and objectives in Customer Relationship Space.

2 thoughts on “Dynamically Change the Portal Logo based on Logged In User\’s Account

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: