Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - General
Answered

bot.UserDisplayName

(0) ShareShare
ReportReport
Posted on by 55

Good evening.

I'm fairly new to Virtual Agent so please be gentle.

 

I'm trying to make my bot a bit more personal by pulling in the users name. However using the available variable bot.UserDisplayName gives me the full display name, resulting in a message like below:

Hi Bradbury, John I’m xxx, the xxx virtual agent. What can I help you with today?


I just need the first name. Is there a way to do this?

  • Sofiyan Profile Picture
    160 on at
    Re: bot.UserDisplayName

    thanks @Jcook and yes, you are right. Fixed the issue. This was my mistake. Apologies for the churn and thank you again.

  • Jcook Profile Picture
    7,770 Most Valuable Professional on at
    Re: bot.UserDisplayName

    Hi @Sofiyan

     

    it looks like your passing in text instead of an expression in the Get User profile.

     

    Another thing, what is the outputs of your search users.

  • Sofiyan Profile Picture
    160 on at
    Re: bot.UserDisplayName

    @Jcook Very elegant solution...but...I'm getting an error and I'm believe it could be a result of Power Automate functionality changes. Could you suggest anything else to resolve this?

     

    Sofiyan_2-1713387653530.png

     

     

    Error:

    Sofiyan_1-1713387625415.png

     

  • johnbradbury Profile Picture
    55 on at
    Re: bot.UserDisplayName

    Thank you all for replying, it's much appreciated.

  • Verified answer
    F_Quint Profile Picture
    257 on at
    Re: bot.UserDisplayName

    @johnbradbury 

    you can create an 'Action' (Flow), capturing bot.userID. then in your flow add an action called 'Get user profile' using the input from bot.UserID get the 'Given Name' to use in your bot.

     

     

     

     

    F_Quint_1-1604433510184.png

     

     

     

     

    F_Quint_0-1604433478636.png

     

  • Jcook Profile Picture
    7,770 Most Valuable Professional on at
    Re: bot.UserDisplayName

    Hi @johnbradbury 

     

    You can follow the same logic as my post in the link that I shared (Re: Passing variables from PVA in Teams to Power A... - Power Platform Community (microsoft.com))

     

    Just add the Action inside the Greeting Topic, right under the Trigger phrases

  • Jcook Profile Picture
    7,770 Most Valuable Professional on at
    Re: bot.UserDisplayName

    Hello @johnbradbury 

     

    Unfortunately for a greeting you can only use the bot.UserDisplayName.

    Consider posting an idea in the ideas section for this feature:

    Ideas - Power Platform Community (aka.ms)

     

    However if you wanted to use their first name later on in the Chat, you can use Power Automate to get all user details by passing in the bot.UserDisplayName.

    Check this post:

    Re: Passing variables from PVA in Teams to Power A... - Power Platform Community (microsoft.com)

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Copilot Studio - General

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 74

#2
Pablo Roldan Profile Picture

Pablo Roldan 61

#3
stampcoin Profile Picture

stampcoin 10

Overall leaderboard