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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Set variable to the va...
Power Apps
Unanswered

Set variable to the value of person(combo box)

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I am attempting to set the value of a variable to the display name showing in a person field (combo box) on button click.

 

I have the OnSelect property of the combo box set to;

 

 

If(DataCardValue12.Value=true, Set(ManagerNameVAR,DataCardValue4.Selected.DisplayName), Set(ManagerNameVAR,DataCardValue16.Selected.DisplayName);

 

 

 

I have also tried

 

 

If(DataCardValue12.Value=true, UpdateContext({ManagerNameVAR: DataCardValue4.Selected.DisplayName})), UpdateContext({ManagerNameVAR: DataCardValue16.Selected.DisplayName});

 

 

 

DataCardValue12.Value is a toggle

 

Is this possible to achieve, if so how?

 

I appreciate any help on this one.


Thanks

DWTKBrook

Categories:
  • TheRobRush Profile Picture
    11,128 Moderator on at

    Works for me like this.

    Switch(
     Toggle1.Value,
     true, 
     UpdateContext({ManagerNameVAR:ComboBox2.Selected.DisplayName}),
     UpdateContext({ManagerNameVAR:ComboBox1.Selected.DisplayName})
     )

     

    will need to rename the controls to same name of controls in your form.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard