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

Filter two sharepint list in a combo box

Good Day,

I have two sharepoint lists, in the first one I have the client's ID and the client's name, in another table I have the advisor's name and the client's id. I need to show in a combo box the Name of the clients that belong to a particular advisor.

 

Additionally, when the record is selected, the Id related to the selected name of the client would need to be saved in a third table.

 

Thanks for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @gaffyjes ,

 

For your first request:

1\ This is my list 'LIST108'. 'advisor_name' and 'client_id' are 'Single line of text' columns.

v-xiaochen-msft_0-1618297498922.png

 

2\ This is my list 'LIST109'.  'client_ID' and 'client_name' are 'Single line of text' columns.

v-xiaochen-msft_1-1618297523769.png

 

3\ Add a combo box control 'ComboBox1' and set its Items property to:

Distinct(LIST108,advisor_name)

 

Set 'ComboBox1' 's DisplayFields property to:

["Result"]

 

4\ Add a combo box control 'ComboBox2' and set its Items property to:

ForAll(Filter(LIST108,advisor_name=ComboBox1.Selected.Result),LookUp(LIST109,client_ID=client_id))

 

5\ The result is as follows:

v-xiaochen-msft_2-1618298197487.png

v-xiaochen-msft_3-1618298207452.png

 

 

For your second request:

I am not sure in which data source the third table mentioned in your article is located.

I assume you have such a table in the list.

v-xiaochen-msft_4-1618298412728.png

You could set the Onchange property of 'ComboBox2' control to:

Patch(LIST110,Defaults(LIST110),{Title:"MyTest",advisor_name:ComboBox1.Selected.Result,client_id:ComboBox2.Selected.client_ID,client_name:ComboBox2.Selected.client_name})

Whenever you select the value of the second combo box control 'ComboBox2', it will automatically patch a record to the third table/list ‘LIST110’.

 

The result is as follows:

v-xiaochen-msft_5-1618298727694.png

v-xiaochen-msft_6-1618298738967.png

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi @gaffyjes ,

 

For your first request:

1\ This is my list 'LIST108'. 'advisor_name' and 'client_id' are 'Single line of text' columns.

v-xiaochen-msft_0-1618297498922.png

 

2\ This is my list 'LIST109'.  'client_ID' and 'client_name' are 'Single line of text' columns.

v-xiaochen-msft_1-1618297523769.png

 

3\ Add a combo box control 'ComboBox1' and set its Items property to:

Distinct(LIST108,advisor_name)

 

Set 'ComboBox1' 's DisplayFields property to:

["Result"]

 

4\ Add a combo box control 'ComboBox2' and set its Items property to:

ForAll(Filter(LIST108,advisor_name=ComboBox1.Selected.Result),LookUp(LIST109,client_ID=client_id))

 

5\ The result is as follows:

v-xiaochen-msft_2-1618298197487.png

v-xiaochen-msft_3-1618298207452.png

 

 

For your second request:

I am not sure in which data source the third table mentioned in your article is located.

I assume you have such a table in the list.

v-xiaochen-msft_4-1618298412728.png

You could set the Onchange property of 'ComboBox2' control to:

Patch(LIST110,Defaults(LIST110),{Title:"MyTest",advisor_name:ComboBox1.Selected.Result,client_id:ComboBox2.Selected.client_ID,client_name:ComboBox2.Selected.client_name})

Whenever you select the value of the second combo box control 'ComboBox2', it will automatically patch a record to the third table/list ‘LIST110’.

 

The result is as follows:

v-xiaochen-msft_5-1618298727694.png

v-xiaochen-msft_6-1618298738967.png

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

Thanks so much, the function worked perfect.

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (66,172)