cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
westerdaled
Helper V
Helper V

Filtering a choice field combo box revisited: filtering works but not the selection

 

Firstly, I hope this post is not tagged as spam like my last and entirely innocent post 🙄 which i did resolve by editing the flow source code. 

 

Anyway in my cavass App I have defined a lookup column in my main list 

 

Finanical Code column -> Financial Code list

Customer Changes lookup column.PNG

 

Works fine in a Form fixed values DataCard

 

But what if I want to filter on one of the colums depending on which form the Lookup is used. Also, why don't I also concatenate the code and the description so the display choice values look more user friendly.

 

The filtering works but not the concatenation in the display  choice values😣 ( see image below).

 

In the items function

 

 

//  Choices([@'Customer Changes'].Financial_x0020_Code)

 ShowColumns(Filter('Financial Code', InUseForChangesForm =1),"Title","CostCentreDescription")

 

 

In the Update function of the  DataCard 

This also doesn't work as the lookup value is not applied when the form is submitted, nor are any of the other lookup column values shown in the definition.

DataCard Update function.PNG

 

I did find  trying to filter using:  Choices([@'Customer Changes'].Financial_x0020_Code) not possible so went for the lookup list. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @westerdaled ,

 

One thing you need to know is that LookUp field value is a whole record coming from the target list, but display value in both SP list LookUp field and Power Apps Combo box control would only come from the display field you have set in SP list settings.

 

To accomplish your need of filling the Combobox with the custom values from the target list, you will need to:

1\ Items of the Combo box:

AddColumns(ShowColumns('Financial Code',"Title","CostCentreDescription"),"concatenation",Concatenate(ThisRecord.Title,"&",ThisRecord.CostCentreDescription))

This is the new table including all items for users to select from.

 

2\ Set the display field of the Combo box to be the concatenation field. So the display field in dropdown list of the Combo box would show the customized Title&CostCentreDescription values.

 

3\ Update of the DataCard:

LookUp(Choices([@'Customer Changes'].Financial_x0020_Code),Value = DataCardValue.Selected.Title)

This would help update the whole record to the LookUp field according to the selected item

 

4\ DefaultSelectedItems of the Combo box:

LookUp(AddColumns(ShowColumns('Financial Code',"Title","CostCentreDescription"),"concatenation",Concatenate(ThisRecord.Title,"&",ThisRecord.CostCentreDescription)),Title = ThisItem.Financial_x0020_Code.Value)

This would pre-populate the combo box with the concatenation value based on the selected item from the Gallery if it is an Edit Form.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

westerdaled
Helper V
Helper V

@v-jefferni 

 

Thanks very much ,  I fully understand this approach and what you mean by the lookup column settings - the temp column is quite neat. 

 

In the combo box field, I have set the display field and the Search field in the combo to "concatenate"  . The only issue is it gets confused with the first part of description - great if it has a second word to search on or using just the code.

 

I have implemented it now and will add the filter at lunchtime as I am on migration fix duties atm

Update: 

Here is the filter I have now added to your orginal statement

 

 

 

Filter(AddColumns(ShowColumns('Financial Code',"Title","CostCentreDescription", "InUseForChangesForm"),"concatenation",Concatenate(ThisRecord.Title,":",ThisRecord.CostCentreDescription)),InUseForChangesForm =1)

 

 

The Filter / AddColumns syntax in the docs confused me for a while  AddColumns with Filter example

View solution in original post

2 REPLIES 2
v-jefferni
Community Support
Community Support

Hi @westerdaled ,

 

One thing you need to know is that LookUp field value is a whole record coming from the target list, but display value in both SP list LookUp field and Power Apps Combo box control would only come from the display field you have set in SP list settings.

 

To accomplish your need of filling the Combobox with the custom values from the target list, you will need to:

1\ Items of the Combo box:

AddColumns(ShowColumns('Financial Code',"Title","CostCentreDescription"),"concatenation",Concatenate(ThisRecord.Title,"&",ThisRecord.CostCentreDescription))

This is the new table including all items for users to select from.

 

2\ Set the display field of the Combo box to be the concatenation field. So the display field in dropdown list of the Combo box would show the customized Title&CostCentreDescription values.

 

3\ Update of the DataCard:

LookUp(Choices([@'Customer Changes'].Financial_x0020_Code),Value = DataCardValue.Selected.Title)

This would help update the whole record to the LookUp field according to the selected item

 

4\ DefaultSelectedItems of the Combo box:

LookUp(AddColumns(ShowColumns('Financial Code',"Title","CostCentreDescription"),"concatenation",Concatenate(ThisRecord.Title,"&",ThisRecord.CostCentreDescription)),Title = ThisItem.Financial_x0020_Code.Value)

This would pre-populate the combo box with the concatenation value based on the selected item from the Gallery if it is an Edit Form.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

westerdaled
Helper V
Helper V

@v-jefferni 

 

Thanks very much ,  I fully understand this approach and what you mean by the lookup column settings - the temp column is quite neat. 

 

In the combo box field, I have set the display field and the Search field in the combo to "concatenate"  . The only issue is it gets confused with the first part of description - great if it has a second word to search on or using just the code.

 

I have implemented it now and will add the filter at lunchtime as I am on migration fix duties atm

Update: 

Here is the filter I have now added to your orginal statement

 

 

 

Filter(AddColumns(ShowColumns('Financial Code',"Title","CostCentreDescription", "InUseForChangesForm"),"concatenation",Concatenate(ThisRecord.Title,":",ThisRecord.CostCentreDescription)),InUseForChangesForm =1)

 

 

The Filter / AddColumns syntax in the docs confused me for a while  AddColumns with Filter example

View solution in original post

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,661)