Skip to main content

Hello

 

I'm currently outputting the current user Full Name in CRM Analytics, but I'd like to change this to only show First Name.  It seems like this should be simple but I'm struggling to find the field name to use.  My current code is below - which successfully outputs my own name on screen:

 

q = load "User";

q = group q by all;

q = foreach q generate "!{User.Name}" as 'username';

q = limit q 2000;

 

When I change "!{User.Name}" and instead use "!{User.FirstName}" it returns and undefined values and therefore just outputs the string "!{User.FirstName}" on screen.

 

Thanks for any help!

3 件の回答
  1. Prabhat Mishra (Salesforce) Forum Ambassador
    2024年1月18日 15:43

    Hi @Giuseppe De Stasio,

    Only user.id, user.name, user.rolename, and user.roleid tokens are supported.

     

    You can try :

    q = load "User";

    q = filter q by 'Id' == "!{User.Id}";

    q = group q by ('FirstName');

    q = foreach q generate 'FirstName' as 'FirstName';

    q = limit q 2000;

    or use a direct query:

    SELECT FirstName FROM User WHERE Id = '!{User.Id}'
0/9000