cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AislingFaulkner
Helper I
Helper I

Combining AddColumn and Search

I have a gallery that needs a column from one datasource added to it, so I use 

AddColumns(
    Leave,
    "Name",
    LookUp(
        Balance,
        EmployeeEmail in Leave[@Requester],
        EmployeeName
    )
)

I also need to search the gallery, with the new column, so the code would be 

Search(Leave, Searchbox.text, "Status", "Name")

 How do I combine these operations so that they both apply?

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User II
Super User II

Hi @AislingFaulkner 

 

Search(
       AddColumns(
                 Leave, "Name",LookUp(
                                      Balance,
                                             EmployeeEmail in Leave[@Requester],
                                                                               EmployeeName
                                )
          ),Searchbox.text, "Status", "Name"
 )

 

 

FYI, PowerApps executes its functions from the "Inside Out".  Your first function Adds the column and reshapes the "Leave" table.  You then wrap the Search function around the modified table that has the new column in it.  Keep in mind that the Table Shaping functions like AddColumns(), ShowColumns(), RenameColumns(), etc. are not delegatable.

View solution in original post

1 REPLY 1
Drrickryp
Super User II
Super User II

Hi @AislingFaulkner 

 

Search(
       AddColumns(
                 Leave, "Name",LookUp(
                                      Balance,
                                             EmployeeEmail in Leave[@Requester],
                                                                               EmployeeName
                                )
          ),Searchbox.text, "Status", "Name"
 )

 

 

FYI, PowerApps executes its functions from the "Inside Out".  Your first function Adds the column and reshapes the "Leave" table.  You then wrap the Search function around the modified table that has the new column in it.  Keep in mind that the Table Shaping functions like AddColumns(), ShowColumns(), RenameColumns(), etc. are not delegatable.

View solution in original post

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (35,198)