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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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