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

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
    152,859 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
    152,859 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

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 759 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 310 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 228

Last 30 days Overall leaderboard