Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Property Items in a gallery

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?
  • WarrenBelz Profile Picture
    WarrenBelz 143,487 on at
    Property Items in a gallery
    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
  • WarrenBelz Profile Picture
    WarrenBelz 143,487 on at
    Property Items in a gallery
    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

     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,487

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,014

Leaderboard