cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Thanasis
Helper IV
Helper IV

Combo box search 365 user / save email addresses to SharePoint list

Hello,

 

I was wondering if any body can help me with this. 

 

What I am trying to do is, create a combo box displaying all my 365 users alphabetically 

I use this: 

 

SortByColumns(Distinct(Office365Users.SearchUserV2({searchTerm:""}).value, DisplayName
), "Result", Ascending)

 

 

The Combo box, works, now what I want to do is take from those names that the user picked and save only the emails to a column in SharePoint list. So then I can have a flow running and take those emails and send them an email. 

Whenever I try to grab from all the users selected from that combo box it only saves one entry, Can anybody help me solve this. I think I might have to create a collection, but I would appreciate any help I can get on this

 

 

Thank you 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yujincui-msft
Community Support
Community Support

Hi @Thanasis ,

 

The return value of the formula you provided is a single column table with only the DisplayName field.

If you want to save multiple Mails to a Single line of text column in a SharePoint list, i have made a test for your reference.

 

1. Select the Combo Box Control and apply the following formula on its Items property  as:

SortByColumns(Office365Users.SearchUserV2({searchTerm:""}).value,"DisplayName")

2. Select the Button Control and apply the following formula on its OnSelect property as:

Patch(datasource,Defaults(datasource),{Title:"test",EmailsColumn:Concat(ComboBox2.SelectedItems,Mail,";")})

vyujincuimsft_1-1651732400765.png

Result Screenshot:

vyujincuimsft_0-1651732288148.png

Best Regards,
Charlie Choi

View solution in original post

3 REPLIES 3
v-yujincui-msft
Community Support
Community Support

Hi @Thanasis ,

 

The return value of the formula you provided is a single column table with only the DisplayName field.

If you want to save multiple Mails to a Single line of text column in a SharePoint list, i have made a test for your reference.

 

1. Select the Combo Box Control and apply the following formula on its Items property  as:

SortByColumns(Office365Users.SearchUserV2({searchTerm:""}).value,"DisplayName")

2. Select the Button Control and apply the following formula on its OnSelect property as:

Patch(datasource,Defaults(datasource),{Title:"test",EmailsColumn:Concat(ComboBox2.SelectedItems,Mail,";")})

vyujincuimsft_1-1651732400765.png

Result Screenshot:

vyujincuimsft_0-1651732288148.png

Best Regards,
Charlie Choi

Thanasis
Helper IV
Helper IV

Thank you @v-yujincui-msft  that fixed my issue 

Hi Charlie,

 

Hope you are well. 

I am trying to use above formula, but it creates multiple line items in sharepoint list with Patch function for me. 

 

My Sharepoint List - Workshop

has list of accounts and I am using a form (which has edit and new form fields based on user input through button) 

My field - Attendees and Department

 

Attendees - Default Select Items =If(FormMode.New,[ThisItem.Attendees],[Parent.Default])

Items - SortByColumns(Office365Users.SearchUserV2({searchTerm:ComboBox4.SearchText}).value,"DisplayName")

Search Fields - ["DisplayName", "Department"]

Same formula for Department however that is a disabled field in my form - i want Department to be also searched based on same combo box and patch to sharepoint 

SortByColumns(Office365Users.SearchUserV2({searchTerm:ComboBox4.SearchText}).value,"Department")

 

What i dont know is ......

1) What needs to go in Update property? because currently its picking up last or sometimes first selected item from combo box.

2) Where do i put a filter in patch becuase I cant select "gallery.selected" as there will be new form input at times. 

 

Request you to please answer this and in case it is already answered, i would request you to route me to the link/answer. 
Thank you in advance for your support. 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

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

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,895)