cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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 @Anonymous :

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

Anonymous
Not applicable

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

 

 

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (3,985)