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 / How to get O365Users i...
Power Apps
Answered

How to get O365Users into a SharePoint list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi PA Community,

 

Relatively new to all this so any expertise, wisdom and guidance to proceed with this connundrum would be greatly appreciated.

 

With the help of the YouTube and Microsft PA community I have built 2 different apps that work. The first is an app to submit data from a form to a SharePoint site, where notifications can be pushed to anyone with a need to know. The second, an app to add multiple users (as owners or members) to multiple Teams sites. I now need to combine some of that functionality.

 

The app has a connection to the SharePoint site, as well as to O365 Users.   In the Course Leader box I have a combo box that succesfully pulls the searched and selected Course Leader. The form has 2 screens (only form 1 is shown below), and the submit button is on the second screen. The app successfully submits all the manually input data. What I am struggling with is how to get the selected course leader into the sharepoint site.

mc00515_0-1677857211186.png

The Combo box uses the following function in the items..

 

Office365Users.SearchUser({searchTerm:'Course Leader ComboBox2'.SearchText, top:100})

 

The Sharepoint is list is as follows:

mc00515_1-1677857498376.png

Any any advice to get the data into the column circled above would be appreciated (or ask if you require any further info from me)?

Thanks in advance,

DEM

 

 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,703 Super User 2026 Season 1 on at

    Hi @Anonymous ,

     

    Try changing the Items property of the ComboBox to:

     

    Choices('Course Review Report'.'Course Leader')

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for responding @BCBuizer , though I'm not entirely sure I follow your guidance. If by changing the Items property of the ComboBox, you mean ...

     

    Replacing this  .....Office365Users.SearchUser({searchTerm:Self.SearchText, top:999}

     

    With this......         Choices(‘Course Review Report’.’Course Leader’)

     

    I see this error...

    mc00515_2-1678103387289.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I am also not sure how the comand  Choices(‘Course Review Report’.’Course Leader’) would be able to draw down the users from our Office 365 Azure AD, much less be able to pass that to the SharePoint List?

  • Verified answer
    BCBuizer Profile Picture
    22,703 Super User 2026 Season 1 on at

    Hi @Anonymous 

     

    Since 'Course Leader' is a Person type column, SharePoint is in itself connecting to AAD to retrieve the information from there. 

     

    I think the reason you are getting an error is because you are using curly quotes instead of straight quotes.

     

    Can you please try copy-pasting exactly what I suggested before?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks @BCBuizer , this did fix the error, but it didn't fix the overall scope of what I had hoped to achieve. That is to report the correct date and time. I believe the function you have provided, to my surprise, works in a similar manner O365 search function. I will, however, accept your solution.

     

    The issue I still experience is with the time locale. 

    The date correctly defaults to the current date, but If the user doesn't complete the hour and minutes, it was reporting a date and time yesterday. This is because the locale on our systems had not been set to UK time. Once I reset the locale, the date reports correctly.  The issue however, is the time reports 00:00. Power Apps is obviously now reporting the correct time, but I would want it to report the current time instead.

     

    Is there a way to code the reported hour and minutes to be the current value if unselected. I have set the update as in the date card as follows.

    Switch(IsBlank(HourValue1) || IsBlank(MinuteValue1), true, DateTimeValue(DateValue1.SelectedDate& "00:00"), DateTimeValue(DateValue1.SelectedDate&" "&HourValue1.Selected.Value&":"&MinuteValue1.Selected.Value))

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    In Summary, I require the date, hour and minutes to default to current date, hour and minutes if unselected, and to report the selections when selected. 

     

    I have managed some success by selecting Today() on the default date and setting AllowEmptySelection to true on the hour and minute controls. That solves the problem if no selection is made, but not if a retroactive date is set.

     

    I understand what if/else statements in nested Excel functions, but I am new to the Power Apps code syntax. 

    Any guidance how to solve that riddle would be gratefully received. 

     

  • BCBuizer Profile Picture
    22,703 Super User 2026 Season 1 on at

    Hi @Anonymous ,

     

    Can you please open a new topic for this second issue? Like that it's easier to find solutions to issues for other members of the community.

     

    Please feel free to tag me for a response.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 936

#2
Valantis Profile Picture

Valantis 604

#3
11manish Profile Picture

11manish 518

Last 30 days Overall leaderboard