cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stephane33
Frequent Visitor

unable to get users informations with connector o365User

Hello,

 

I try to build a new powerapps but I have some difficulty to make it.

 

I set a comboBox to connect to a sharepoint list. Once item is selected, the goal is to get value from the field "ownerstxt"  .  This field contains a list of concatened mail users separated by ",".

I try to display my result in a gallery and would add more informations like displayname, derpartment and companyName and even if available the photo.

 

I added this formule on the event "OnChange" from the Combobox :

 

 

 

 

ClearCollect(collectUsers,ForAll(Split(ComboBox1.Selected.OwnerTxt,","),'Utilisateursd''Office365'.UserProfileV2(Result)))

 

 

 

 

My collection "CollectUsers" return only the first user. I doesn't understand why it not loop on others users ?

Capture2.PNG

 

If I try whihout the connector o365User I have all my users in the collection.

 

 

 

ClearCollect(collectUsers,ForAll(Split(ComboBox1.Selected.OwnerTxt,","),Result))

 

 

 

 

collectUserName.PNG

 

Can you explain me where i'm wrong ?

 

Thanks

 

Regards

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @stephane33 :

Could you tell me what 'Utilisateursd' is?

I made a similar test but did not encounter the problem you mentioned.

Here is my solution:

1\add a Office 365 User connection

Data sources-Connectors-Office 365 Users-Add a connection

2\add a button control and set its OnSelect Property to:

 

ClearCollect(
    collectUsers,
    ForAll(
        Split(
            "xxxx@xxxxxxx.com,sssss@ssssss.com",
            ","
        ),
        Office365Users.UserProfileV2(Result)
    )
)

 

You can also try this code:

 

  ForAll(
        Split(
            ComboBox1.Selected.OwnerTxt,
            ","
        ),
        Collect(collectUsers,Office365Users.UserProfileV2(Result))
    )

 

In addition, I suggest you check these following things:

  • Remove 'Utilisateursd'
  • Is there a space in ComboBox1.Selected.OwnerText?
  • Do these users actually exist in your organization's list?

Best Regards,

Bof

Thanks you for your answer. In fact the problem was because there was a space. Corrected with a trim()

 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,322)