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 / Show AD users in combo...
Power Apps
Answered

Show AD users in combo box and save it in entity

(1) ShareShare
ReportReport
Posted on by 12

Hello All,

 

I want to get users from the active directory and show them in the combo box within the canvas App. 

Once, I will select multiple users and it should save in the entity somewhere, but don't know which field or data type I should have to create and also look for editing for the same record after save. Can anyone please suggest to me. 

 

Thanks

 

Categories:
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @rtomar377 ,

    Do you want to save your AD Users back to a CDS Entity?

     

    Regarding the needs that you mentioned, I think the Microsoft365Users.SearchUserV2() function and the Patch function could achieve your needs.

     

    A Office AD User should contains the following properties (highlighted in yellow) at least:

    9.JPGOn your side, you should create a CDS Entity in your PowerApps, then create corresponding Text type fields for these highlighted attribute.

     

    After that, you could consider generate a canvas app based on your above created CDS Entity. The generated canvas app would contains three screens -- BrowseScreen1, DetailScreen1 and EditScreen1. Please add another custom screen, name it as "New User Screen". Within this "New User Screen", add a ComboBox control, and set the Items property to following:

    10.JPG

    Note: I assume that you have added the Microsoft365Users connection into your canvas app already.

    Set the SelecteMultiple property of the ComboBox to following:

    false

     

    Then go to your BroweScreen, set the OnSelect property of the "+" button to following:

    Navigate('New User Screen')

     

    Within your 'New User Screen', set the OnSelect property of the "New Entry" button following:

    Patch(
     'AD Users', // replace it with your own CDS Entity
     Defaults('AD Users'), // replace it with your own CDS Entity
     {
     DisplayName: ComboBox1.Selected.DisplayName, 
     Mail:ComboBox1.Selected.Mail, 
     Department:ComboBox1.Selected.Department, 
     Id:ComboBox1.Selected.Id,
     ...
     }
    );
    Refresh('AD Users'); // replace it with your own CDS Entity
    Navigate(BrowseScreen1)

    when select a user from the ComboBox, and press the "New Entry" button, the selected AD User would be saved back to your CDS Entity.

     

    Patch function

     

    Please try above solution, check if it could help in your scenario.

     

    Regards,

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard