Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to set picture to user profile on the portal

Posted on by 86

Hello all!

I need to set picture (avatar) for portal user profile, but can not find information about this. Can anyone help me with this question? And is this possible to synchronize CRM Contact pictures with the portal ? 

Thanks in advance!

*This post is locked for comments

  • Suggested answer
    OmarZaarour Profile Picture
    OmarZaarour 1,705 on at
    RE: How to set picture to user profile on the portal

    Very late answer, now with the new WebAPI feature on the portal, we can do it. I wrote a post recently on how to do it

    transform365.blog/.../

  • Suggested answer
    _Stacked Profile Picture
    _Stacked 5 on at
    RE: How to set picture to user profile on the portal

    Hello,

     

    I done this using webApi. Quite simple if you consider using it.

     

    if you do not want to go with the webAPI, you can create a new multi-line let’s call it my_customImgField just make sure to choose the appropriate length for the field.

     

    1. Hide the field with javascript or css on portal website.
    2. Create a new upload button file, read the file content and convert it as base64 string (use FileReader.readAsDataURL()) and store it on your hidden multi-lines text field.
    3. set portal image source with your base64 string value.

     

    Make an submit in order to save the field in the CRM, trigger a plugin or custom workflow activity and retrieve the value of the field and set the base64 data (perform a split) to the contact entityimage field (use Convert.FromBase64String C# method).

     

    After for reading mode you can use directly {{user. my_customImgField}} to display user profile picture.

    Ps: if you hide the field on CRM you will probably need to perform an fetchXML on portal profile page in order to get the value of my_customImgField

    Hope this can help

    Best regards

  • Jercy_vz Profile Picture
    Jercy_vz 86 on at
    RE: How to set picture to user profile on the portal

    Hello Jorge! Thank you for the idea.

  • JordiGO Profile Picture
    JordiGO on at
    RE: How to set picture to user profile on the portal

    I have a workaround, not too much elegant but could help you…

    How, you could create a new field on contact record that storage the URL to your image.

    Then you could add JavaScript on the page like:

    for (var i=0, iLen=imgs.length; i<iLen; i++) {

    if(imgs[i].src == "/xrm-adx/images/contact_photo.png")

    {

    imgs[i].src = "your image field";

    imgs[i].height="62";

    imgs[i].width="62";

    }

     }

    };

  • Verified answer
    Jercy_vz Profile Picture
    Jercy_vz 86 on at
    RE: How to set picture to user profile on the portal

    Hello Melina!

    Unfortunately I have received the answer from the MS support - and it was negative. In on-line version there is no way to do this. Maybe they realize this possibility in future.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to set picture to user profile on the portal

    Hello! Could you solve this problem? Thank you!

  • Jercy_vz Profile Picture
    Jercy_vz 86 on at
    RE: How to set picture to user profile on the portal

    Hello Prashant. Thanks for your answer, but I'm using online MS portal and don't know how to implement this solution in my case. Can you help me ? What should I do?

    Thanks in advance.

  • PS Profile Picture
    PS 23,577 on at
    RE: How to set picture to user profile on the portal

    community.adxstudio.com/.../f4d61e4f-07bd-e411-80f7-00155dc0a3d4

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans