3

Is there a way to get current running user name(email, id, whatever) using only data service?

2
  • 1
    ie without a server side controller ? i tried to just load user record using force:recorddata and i got an error "Entitiy not supported", I would say it is not possible to get user info without using a server side controller but would wait and see what others have to say.
    – Rao
    Jun 15, 2017 at 4:46
  • Just one more thing about specifying what object to retrieve - it's not documented, but AFAIK it infers the object type by record ID provided?
    – dzh
    Jun 15, 2017 at 22:32

2 Answers 2

2

It is possible now.

<aura:attribute name="currentUser" type="User" />
<force:recordData
    fields="Name, Email, UserType"
    recordId="{!$SObjectType.CurrentUser.Id}"
    targetFields="{!v.currentUser}"
    mode="VIEW"
/>
3

Not for now. You can find the list of supported entities in the documentation. I would expect the list to grow release after release, so keep an eye on it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .