Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Getting username of current portal user

Posted on by Microsoft Employee

Hi,

Was just wondering if how can I get the username of the user logged in into the portal? Also, is user.id equal to Contact.Id?

Thank you,

rome

*This post is locked for comments

  • Suggested answer
    Justinjose Profile Picture
    Justinjose 2,707 on at
    RE: Getting username of current portal user

    Hi rome,

    See below example

    {% if user %}

     Hello, {{ user.fullname }}!

    {% else %}

     Hello, anonymous user!

    {% endif %}

    Thanks

    Justin Jose

  • Suggested answer
    Dmytro Rutkovskyi Profile Picture
    Dmytro Rutkovskyi 1,835 on at
    RE: Getting username of current portal user

    Refer to Liquid customization, user object - https://docs.microsoft.com/en-us/dynamics365/customer-engagement/portals/liquid-objects#user
    To retrieve any additional parameters (as well of connected entities) you can use fetchxml tag.

    Yes, user in the portal is contact entity in CRM. (see Portal Contact form)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Getting username of current portal user

    Currently, I need to get the domainname of the current user.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans