cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pridez
New Member

Filters Question

Good morning / afternoon / night guys, how are you? I hope well!

I have a question and would like your help.

I am trying to filter some columns in my application.

 

Filter( SortByColumns( Search ( Respostas_Pre_CadastroCC; BuscaNome_1.Text; "Nome_x0020_Fantasia_x003a_"; "Estado_x003a_"; "Insumos_x003a_"; "Regi_x00e3_o_x0020_de_x0020_Atua"; "Materiais_x0020_e_x0020_Equipame"; "Certifica_x00e7__x00f5_es_x003a_"; "Cidade_x003a_"; "Servi_x00e7_os_x0020_Corporativo"; "Servi_x00e7_os_x0020_Industriais");
     "Nome_x0020_Fantasia_x003a_"; If(ordenar=true; Ascending; Descending)
);

    If (Text(Cbx_8.Selected.Value) = "Materiais e Equipamentos"; !IsBlank('Materiais e Equipamentos:'))||
    If (Text(Cbx_8.Selected.Value) = "Serviços Industriais"; !IsBlank('Serviços Industriais:'))||
    If (Text(Cbx_8.Selected.Value) = "Serviços Corporativos"; !IsBlank('Serviços Corporativos:'))||
    If (Text(Cbx_8.Selected.Value) = "Insumos"; !IsBlank('Insumos:'))||
    If (Text(Cbx_8.Selected.Value) = "Energia"; !IsBlank('Energia:'));


    Text(Cbx_9.Selected.Result) in 'Materiais e Equipamentos:' & !IsBlank('Materiais e Equipamentos:')||  
    Text(Cbx_9.Selected.Result) in'Serviços Industriais:'      & !IsBlank('Serviços Industriais:')||  
    Text(Cbx_9.Selected.Result) in'Serviços Corporativos:'     & !IsBlank('Serviços Corporativos:')||
    Text(Cbx_9.Selected.Result) in'Insumos:'                   & !IsBlank('Insumos:')||  
    Text(Cbx_9.Selected.Result) in'Energia:'                   & !IsBlank('Energia:');
    

    Text(Cbx_10.Selected.Result) in 'Estado:' & !IsBlank('Estado:');
    Text(Cbx_11.Selected.Result) in 'Região de Atuação:' & !IsBlank('Região de Atuação:');
    Text(Cbx_12.Selected.Result) in 'Certificações:' & !IsBlank('Certificações:');
    )

 

But the filters are only working if the first filter is selected. can anybody help me?

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User III
Super User III

Hi @Pridez ,

Free-typed (so watch commas/brackets etc), but I try something like this

With(
   {
      w8:Cbx_8.Selected.Value;
      w9:Cbx_9.Selected.Result;
      w10:Cbx_10.Selected.Result;
      w11:Cbx_11.Selected.Result;
      w12:Cbx_12.Selected.Result
   ];
   SortByColumns(
      Search(
         Filter(     
            Respostas_Pre_CadastroCC; 
            Switch(
               w8,
               "Materiais e Equipamentos"; 
               !IsBlank('Materiais e Equipamentos:'),
               "Serviços Industriais"; 
               !IsBlank('Serviços Industriais:');
               "Serviços Corporativos"; 
               !IsBlank('Serviços Corporativos:');
               "Insumos"; 
               !IsBlank('Insumos:')
               "Energia"; 
               !IsBlank('Energia:')
            )||
            w9 in 'Materiais e Equipamentos:' ||  
            w9 in'Serviços Industriais:' ||  
            w9 in'Serviços Corporativos:' ||
            w9 in'Insumos:' ||  
            w9 in'Energia:' ||
            Text() in 'Estado:' ||      //not sure what this is
            w11 in 'Região de Atuação:' ||
            w12 in 'Certificações:'
         );
         BuscaNome_1.Text; 
         "Nome_x0020_Fantasia_x003a_"; 
         "Estado_x003a_"; "Insumos_x003a_"; 
         "Regi_x00e3_o_x0020_de_x0020_Atua"; 
         "Materiais_x0020_e_x0020_Equipame"; 
         "Certifica_x00e7__x00f5_es_x003a_"; 
         "Cidade_x003a_"; 
         "Servi_x00e7_os_x0020_Corporativo"; 
         "Servi_x00e7_os_x0020_Industriais"
      );
      "Nome_x0020_Fantasia_x003a_"; 
      If(
         ordenar=true; 
         Ascending; 
         Descending)
      )
   )
)

 

Please click Accept as solution 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 Thumbs Up.

View solution in original post

2 REPLIES 2
WarrenBelz
Super User III
Super User III

Hi @Pridez ,

Free-typed (so watch commas/brackets etc), but I try something like this

With(
   {
      w8:Cbx_8.Selected.Value;
      w9:Cbx_9.Selected.Result;
      w10:Cbx_10.Selected.Result;
      w11:Cbx_11.Selected.Result;
      w12:Cbx_12.Selected.Result
   ];
   SortByColumns(
      Search(
         Filter(     
            Respostas_Pre_CadastroCC; 
            Switch(
               w8,
               "Materiais e Equipamentos"; 
               !IsBlank('Materiais e Equipamentos:'),
               "Serviços Industriais"; 
               !IsBlank('Serviços Industriais:');
               "Serviços Corporativos"; 
               !IsBlank('Serviços Corporativos:');
               "Insumos"; 
               !IsBlank('Insumos:')
               "Energia"; 
               !IsBlank('Energia:')
            )||
            w9 in 'Materiais e Equipamentos:' ||  
            w9 in'Serviços Industriais:' ||  
            w9 in'Serviços Corporativos:' ||
            w9 in'Insumos:' ||  
            w9 in'Energia:' ||
            Text() in 'Estado:' ||      //not sure what this is
            w11 in 'Região de Atuação:' ||
            w12 in 'Certificações:'
         );
         BuscaNome_1.Text; 
         "Nome_x0020_Fantasia_x003a_"; 
         "Estado_x003a_"; "Insumos_x003a_"; 
         "Regi_x00e3_o_x0020_de_x0020_Atua"; 
         "Materiais_x0020_e_x0020_Equipame"; 
         "Certifica_x00e7__x00f5_es_x003a_"; 
         "Cidade_x003a_"; 
         "Servi_x00e7_os_x0020_Corporativo"; 
         "Servi_x00e7_os_x0020_Industriais"
      );
      "Nome_x0020_Fantasia_x003a_"; 
      If(
         ordenar=true; 
         Ascending; 
         Descending)
      )
   )
)

 

Please click Accept as solution 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 Thumbs Up.

View solution in original post

WarrenBelz
Super User III
Super User III

Hi @Pridez ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution 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 Thumbs Up.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (87,542)