web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Lookup Field with multiple search columns in PowerApps.

Community Member Profile Picture Community Member

Introduction:

In this blog, we will learn how to set multiple search fields in a Lookup Field.

Use Case:

We have a requirement where there is a Field (Data Field: Lookup) on the form, which should search records according to multiple columns. The Field on the Form is a Combo Box

Steps:

1. This is the form of Quote Product. We want to allow searching based on multiple column.

2. To allow searching based on multiple fields, click on the Combo Box.

Items property:

Set ExistingProduct.Items =  Sort(
                                                   Filter(
                                                       Filter(
                                                              Data Source,
                                                              Condition
                                                             ),
                                                          StartsWith(
                                                                Text, SearchText
                                                     ) Or StartsWith( Text, SearchText
                                                )
                                             ),
                                           ColumnName
                                       )
For eg: ExistingProductQPEditForm_2.Items =Sort(
                                                            Filter(
                                                                    Filter(
                                                                                [@Products],
                                                                                Status = 'Status (Products)'.Active
                                                                             ),
                                                                   StartsWith(
                                                                               'Product Code',
                                                                               ExistingProductQPEditForm_2.SearchText
                                                                             ) Or StartsWith(
                                                                             Name,
                                                                             ExistingProductQPEditForm_2.SearchText
                                                                              )
                                                                      ),
                                                                     Name
                                                                )

SearchFields property:

Set ExistingProduct.SearchFields =  { "ColumnName", "ColumnName"}
For eg: ExistingProductQPEditForm_2.SearchFields = {"cf_productcode", "name"}

Conclusion:

Hope the above Blog helps you to search based on multiple columns for the Lookup field.

The post Lookup Field with multiple search columns in PowerApps. appeared first on Cloudfronts - Microsoft Dynamics 365 | Power BI | Azure.

Comments

*This post is locked for comments