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 / Property Items in a g...
Power Apps
Answered

Property Items in a gallery

(0) ShareShare
ReportReport
Posted on by 2
I'm trying to put two commands in the items property in my gallery.
I need to put SortByColumns and I also want an If for other controls.
Here's what I have:
 
 
SortByColumns(
  DemandasGLPCE;
  "cr303_numerodemanda";
  If(
    classNumDemanda = true;
    SortOrder.Ascending;
    SortOrder.Descending
  )
);;
 
If(MyVar=1; Filter(DemandasGLPCE;Elaborador=User().Email); If(MyVar=2;DemandasGLPCE;Search(DemandasGLPCE;Txt_Pesquisa.Text;Elaborador;Descricao;DOD;ETP;PB;Obs;NumeroDemanda;Pedido)))
 
 
Both commands, individually, work perfectly, but I can't run it as shown above.
NOTE: I used two semicolons to separate the commands, because my Office is in Portuguese.
 
Does anyone have a solution, please?
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,534 Most Valuable Professional on at
    This should do the job
    SortByColumns(
       Filter(
          DemandasGLPCE;
          (
             MyVar = 1 && 
             Elaborador = User().Email
          ) ||
          (
             MyVar = 2 &&
                (
                   Txt_Pesquisa.Text in Elaborador ||
                   Txt_Pesquisa.Text in Descricao ||
                   Txt_Pesquisa.Text in DOD ||
                   Txt_Pesquisa.Text in ETP ||
                   Txt_Pesquisa.Text in PB ||
                   Txt_Pesquisa.Text in Obs ||
                   Txt_Pesquisa.Text in NumeroDemanda ||
                   Txt_Pesquisa.Text in Pedido
                )
             )
          )
       );
       "cr303_numerodemanda";
       If(
          classNumDemanda;
          SortOrder.Ascending;
          SortOrder.Descending
       )
    );;
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     
  • WarrenBelz Profile Picture
    154,534 Most Valuable Professional on at
    Just following up to see if you received the answer you needed, or if you require further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffe

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 545 Most Valuable Professional

#2
Haque Profile Picture

Haque 314

#3
Kalathiya Profile Picture

Kalathiya 234 Super User 2026 Season 1

Last 30 days Overall leaderboard