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 / Default valued for Com...
Power Apps
Answered

Default valued for Combo Box based on Person Column in Sharepoint list

(0) ShareShare
ReportReport
Posted on by 43

Hello again,

 

I have a column named 'Supervisor' in Sharepoint list of type 'Person or Group'. I want to display the current Supervisor name (from Office365 connector) of the employee who will be using this app.

 

The Supervisor name is to be displayed on the top of the app screen. I am able to display the Supervisor name as a default entry in the combo box using 'DefaultSelectedItems' . But it is not shown on the button which says 'Your Supervisor for today -'.

However, if I delete the default entry, and then search for the name and select it, I see that 'Your Supervisor for today -' displays the searched and selected name.

 

How can I resolve this?

 

AmitY_0-1609289396708.png

 

Categories:
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @AmitY ,

     

    Since you would like to display the default supervisor of current user in the lable, why not directly apply the formula, which retrieves the manager of current user in that Combo box, on the Label?

     

    So, modify the Text of the Label to:

     

    Concatenate("Your Supervisor for today - ",Office365Users.SearchUser({searchTerm:varManagerEMail,top:1}))

     

    Or

     

    Concatenate("Your Supervisor for today - ",Office365Users.ManagerV2(Gallery.Selected.Supervisor.Email).displayName)

     

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • AmitY Profile Picture
    43 on at

    Thanks @v-jefferni, the purpose is to allow user to change his/her default supervisor for the day.

     

  • Jitendra_jangid Profile Picture
    128 on at

    I would suggest to store manager record on Global/Context variable on Visible of Screen or Start of the App.

    Office365Users.ManagerV2(Gallery.Selected.Supervisor.Email)

     And OnChange of your combo box update the variable

  • AmitY Profile Picture
    43 on at

    Thanks @Jitendra_jangid, I have already declared a global variable using the following syntax

      Set(varManagerEMail, Lower(Office365Users.Manager(User().Email).Mail))

    And this variable is now properly populating in the Combo box and the text on the button "Your supervisor is...'.

    But when I added Set(varManagerEMail, DataCardValue1.Selected.Email) in OnChange of my combobox, the varManagerEMail gets resets to blank, and the default item that gets populated in the combo box is the first email address in my AD list, and not the value of varManagerEMail that I set OnStart of the App.

     

    Other thing is, if the user does not change the default item in the combo box and saves the record, he sharepoint list does not update the supervisor email/name. I have the following code in UPDATE of the DataCard of the combo box. And that I found is because DataCardValue1.Selected.mail stays blank in this case. If the user changes the value of the combo box, then sharepoint list column value updates properly.

     

     

    If(EditForm1.Mode = FormMode.New,
    {
    Claims:"i:0#.f|membership|" & DataCardValue1.Selected.mail,
    Department:"",
    DisplayName: DataCardValue1.Selected.DisplayName,
    Email: "",
    JobTitle:"",
    Picture:""
    }, DataCardValue1.Selected )

     

     

    Hope this makes sense?

  • AmitY Profile Picture
    43 on at

    May be I am not passing the right values to the Combobox 'DefaultSelectedItems'???

    Here is the screen grab from the UPDATE command of the Data Card of the Combo box.

     

    AmitY_1-1609350129237.png

     

    AmitY_2-1609351023564.png

     

     

     

  • Verified answer
    AmitY Profile Picture
    43 on at

    Solved!!! Here is what I was missing.

    For the Combo box value properties, I had to modify both 'DEFAULT' and 'DEFAULTSELECTEDITEMS'.

     

    AmitY_0-1609354680125.png

     

    And then here is what was needed for the UPDATE property of DataCard of the combo box

    {
    Claims:"i:0#.f|membership|" & DataCardValue1.Selected.Email,
    Department:"",
    DisplayName: DataCardValue1.Selected.DisplayName,
    Email: "",
    JobTitle:"",
    Picture:""
    }

     

    Here is the article link that helped me

     

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 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard