cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AnthonyDo
Helper III
Helper III

Gallery SortByColumns, Addcolumn from related Dataverse table

Hello everyone,

 

I would like to sort my gallery with table source: Trainees by the column "cref8_remainingbudget" from the table TraineeYearlyBudget. I made a lookup field:

 

2021-08-13 15_35_52-Power Apps.png

 

So i tried researching and adding code to my sort function but it is not behaving how it should behave:

 

 

 

!IsBlank(varSortByBudget),
        SortByColumns(
            AddColumns(
                Trainees,
                "cref8_remainingbudget",
                traineeyearlybudget.cref8_remainingbudget

            ),
            "cref8_remainingbudget",
            If(
                varSortByBudget,
                Ascending,
                Descending
            )
        )

 

 

 

What am i doing wrong here?

 

thanks in advance,

 

Anthony

1 REPLY 1
shavora
Super User
Super User

I believe the name within quotations is just a random name you give the column you are adding. It is not actually referencing anything in this step: AddColumns(Table, "Name of your choice", LookUpTableName)

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (1,360)