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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter & Add columns i...
Power Apps
Unanswered

Filter & Add columns in the same gallery

(0) ShareShare
ReportReport
Posted on by 1,168

Hi,

 

I have a gallery that I would like to add another column. This extra column (colC) just needs to be in all results and will not be filtered against.

 

I also have  1 search box that filters against colA and 1 search box that filters against colB. Both colA & colB are text and can also be blank (meaning all records would be returned in the gallery.

 

Cant quite nail the formatting for the Filter & AddColumns functions and would appreciate any assistance.

 

Thank you

Categories:
  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    @Tango 

    This is the type of structure you would use to combine Filter and AddColumns:

    AddColumns(
     Filter(
     YourDataSource,
     If(
     IsBlank(txtSearchA.Text),
     true,
     ColA = txtSearchA.Text
     ),
     If(
     IsBlank(txtSearchB.Text),
     true,
     ColB = txtSearchB.Text
     ),
     "ColC",
     "YourExpressionForColC"
    )

     

  • Tango Profile Picture
    1,168 on at

    thanks for your response @timl but im getting an error on line 1 next to the ( on Add Columns that says "received 1 but expected 3 or more"

     

    Just a reminder that Im just trying to add the Account Rating column that happens to be a picklist to the Contact Accounts datasource by joining 'Contact Accounts' RefAccount: ID (account id is a lookup column in Sharepoint list)

     

    in addition my filters use the in statement not =

     

    this is my attempt (the add columns is working)

     

    AddColumns(
    Filter(
    'Contact Accounts',
    If(
    IsBlank(txtinpContactAccountsContactSearch.Text),
    true,
    RefContact.Value = txtinpContactAccountsContactSearch.Text
    ),
    If(
    IsBlank(txtinpContactAccountsAccountSearch.Text),
    true,
    RefAccount.Value = txtinpContactAccountsAccountSearch.Text
    ),
    "lu Account Rating",
    LookUp(
    Accounts,
    ID = 'Contact Accounts'[@'RefAccount: ID'].Id,'Account Rating'
    )

  • Tango Profile Picture
    1,168 on at

    this works

    Filter(
    'Contact Accounts',
    txtinpContactAccountsContactSearch.Text in RefContact.Value,
    txtinpContactAccountsAccountSearch.Text in RefAccount.Value)


    and this also works separately

    AddColumns(
    'Contact Accounts',
    "lu Account Rating",
    LookUp(
    Accounts,
    ID = 'Contact Accounts'[@'RefAccount: ID'].Id,'Account Rating')
    )

    Just need to add them together

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Tango 

    With({fltrd:Filter(
     'Contact Accounts',txtinpContactAccountsContactSearch.Text in 
     RefContact.Value, txtinpContactAccountsAccountSearch.Text in 
     RefAccount.Value
     )
     },
     AddColumns(
     fltrd,"lu Account Rating",LookUp(
     Accounts,ID = 'Contact Accounts'[@'RefAccount: 
     ID'].Id,'Account Rating'
     )
     )
    )
  • Tango Profile Picture
    1,168 on at

    Thanks for your message @Drrickryp 

     

    not returning any results before typing in either field (this also needs to happen) and have a squiggly lines over a couple of spots.

     

    i need to return all results before typing in either (or 1) of the search inputs

    Thanks in advance

    Tango_0-1656813832255.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 383 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 356

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard