web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Get current user login in portal

(0) ShareShare
ReportReport
Posted on by

How to get the current user login in the portal then input it in a field?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Macoy Profile Picture
    275 on at

    You could try adding a hidden html input having a liquid notation as value {{user.id}} like this then just get the value of this field with a js/jquery.

    <input id="userID" style="display:none" type="text" value="{{user.id}}" />

    Hope this solve your question.

    Regards,

    Macoy

  • Emmaneul James Abraham Profile Picture
    727 on at

    Hello Vin

    May i know which version of Portal are you using? 7X or 8X?

    Thanks

    James

  • vinvinvin Profile Picture
    on at

    hi emmanuel,

    im using dynamics 365 portal add-on.

  • Verified answer
    vinvinvin Profile Picture
    on at

    on my latest portal instance, it can now autopopulate with current user login

  • Ahmmad Profile Picture
    6 on at

    Hi Macoy,

    this was very useful to me thank you  ,,

    suggest me a tutorial to know the variables that I can reach from the portal page

    I need to reach to the "Account" data for the current portal user:).

    Regards,

    Ahmmad

  • Community Member Profile Picture
    on at

    Hi Ahmmad,

    How exactly you reached to Account data. Steps please.

    Thanks,

    Harsh

  • Community Member Profile Picture
    on at

    Please  ignore I got it, in case if any one needed it quite direct if you are using contact to login on Portal 365-

    {{ user.parentcustomerid.id}}

    To use inside JQuery:  var accountId = '{{ user.parentcustomerid.id}}';

  • David Laeremans Profile Picture
    10 on at

    If you want to get this from the outside(fe angular app hosted in powerapps portals) you can find this on:

    let userId = window.parent["Microsoft"]["Dynamic365"]["Portal"]["User"]["contactId"];
    (there is one additional property "name" on user which is the username of the (contact)user but with the id you can get the additional details if needed.
    (when unauthenticated the user object will still be initialized but with empty values on said properties)
    I suggest you inspect window.parent["Microsoft"] to see what other variables are available to you.
  • Bidabehere Profile Picture
    10 on at

    It works perfect. It is the id you use to enter.

    Thanks!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans