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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add Column with Sort, ...
Power Apps
Unanswered

Add Column with Sort, Search, and Filter for a Gallery not working properly. New Column has the same value for all records.

(0) ShareShare
ReportReport
Posted on by 51

Hi,

I am attempting to add a column that will be available for search.  The statement is below.  The problem is the new column has the same value in it.  

Moksha_0-1677515535256.png

The TestSearch column is the one with the 19 in all rows.  It should be the same number as the Request Number.

Moksha_1-1677515708515.png

 

Any help would be appreciated.  I'm guessing the Add Columns should be inside the Filter somehow but I can't get that to work either.  

 

 

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Moksha,

     

    When using a lot of formulas that loop through your datasource (filter, addcolumns, showcolumns, lookup...) Power Apps sometimes gets confused what 'ThisRecord' actually refers to. In this case, we can explicitly tell Power Apps what record we want to refer to.

     

    Would it be possible to add the following changes to your code:

     

    (1) At the end of your filter statement write 'As Main'

    //Your code...
    'Work Item Status'<>"Closed") As Main,
    //Your code...

     

    (2) Swap the code for your textSearch with:

    //Your code here...
    "TestSearch", Text(Main.'Request Number')),
    //Your code here...

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • Moksha Profile Picture
    51 on at

    Hi @LaurensM ,

    I think I understood what you were asking me to do but just in case.  Here is the code I changed.   

     

     

     

    Moksha_0-1677526035209.png

    I receive these errors.  It doesn't seem to like my as Main

    Moksha_1-1677526127937.png

    Thank you for helping.

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Moksha,

    More than happy to help.

     

    Some small adjustments:

    1. 'as' should be written with a capital letter - As.
    2. You want to close the AddColumns bracket after the Text() formula (see previous code with two round brackets at the end)

    This should fix the current error.

     

    I hope this helps!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard