cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kishama
Helper I
Helper I

Error when entering several functions in the items property of the datatable

hello,

I have a problem separating my functions inside my items property of my datatable.

I have tried with ";" too ";;" and ","

kishama_1-1653420753871.png

Thanks for your help

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi @kishama 

I think I see where the error is. Can you try the following to see if that works better?

AddColumns(Search(tbticket;txtbuscar.Text;"idticket") As tbBuscar;
            "Cliente";LookUp(tbcliente;idcliente=tbBuscar[@idcliente]).cliente;
            "Usuario";LookUp(tbusuario;idusuario=tbBuscar[@idusuario]).abreviatura;
            "Producto";LookUp(tbproducto;idproducto=tbBuscar[@idproducto]).producto;
            "Servicio";LookUp(tbservicio;idservicio=tbBuscar[@idservicio]).servicio;
            "Dep Origen";LookUp(tbdepartamento;iddepartamento=tbBuscar[@deporigen]).departamento;
            "Prov Origen";LookUp(tbprovincia;idprovincia=tbBuscar[@provorigen]).provincia;
            "Dist Origen";LookUp(tbdistrito;iddistrito=tbBuscar[@distorigen]).distrito;
            "Dep Destino";LookUp(tbdepartamento;iddepartamento=tbBuscar[@depdestino]).departamento;
            "Prov Destino";LookUp(tbprovincia;idprovincia=tbBuscar[@provdestino]).provincia;
            "Dist Destino";LookUp(tbdistrito;iddistrito=tbBuscar[@distdestino]).distrito;
            "Moneda";LookUp(tbmoneda;idmoneda=tbBuscar[@idmoneda]).moneda
)

View solution in original post

4 REPLIES 4
timl
Super User
Super User

Hi @kishama 

The solution here is to nest the call to Search inside AddColumns. The formula you add to the Items property of your datatable would look like this:

AddColumns(
           Search(tbticket;txtbuscar.Text;"idticket");
           "cliente";LookUp(tbcliente;idcliente=tbticket[@idclient]).cliente;
           "Usuario";LookUp(tbusuario;idusuario=tbticket[@idusuario]).abreviatura;
           .......
)

 

Hi @timl ,

Now I get the error:

Incompatible types for comparison. These types cannot be compared: Text, Table

AddColumns(Search(tbticket;txtbuscar.Text;"idticket");
            "Cliente";LookUp(tbcliente;idcliente=tbticket[@idcliente]).cliente;
            "Usuario";LookUp(tbusuario;idusuario=tbticket[@idusuario]).abreviatura;
            "Producto";LookUp(tbproducto;idproducto=tbticket[@idproducto]).producto;
            "Servicio";LookUp(tbservicio;idservicio=tbticket[@idservicio]).servicio;
            "Dep Origen";LookUp(tbdepartamento;iddepartamento=tbticket[@deporigen]).departamento;
            "Prov Origen";LookUp(tbprovincia;idprovincia=tbticket[@provorigen]).provincia;
            "Dist Origen";LookUp(tbdistrito;iddistrito=tbticket[@distorigen]).distrito;
            "Dep Destino";LookUp(tbdepartamento;iddepartamento=tbticket[@depdestino]).departamento;
            "Prov Destino";LookUp(tbprovincia;idprovincia=tbticket[@provdestino]).provincia;
            "Dist Destino";LookUp(tbdistrito;iddistrito=tbticket[@distdestino]).distrito;
            "Moneda";LookUp(tbmoneda;idmoneda=tbticket[@idmoneda]).moneda
)

kishama_0-1653423786367.png

Thank you very much for answering.

timl
Super User
Super User

Hi @kishama 

I think I see where the error is. Can you try the following to see if that works better?

AddColumns(Search(tbticket;txtbuscar.Text;"idticket") As tbBuscar;
            "Cliente";LookUp(tbcliente;idcliente=tbBuscar[@idcliente]).cliente;
            "Usuario";LookUp(tbusuario;idusuario=tbBuscar[@idusuario]).abreviatura;
            "Producto";LookUp(tbproducto;idproducto=tbBuscar[@idproducto]).producto;
            "Servicio";LookUp(tbservicio;idservicio=tbBuscar[@idservicio]).servicio;
            "Dep Origen";LookUp(tbdepartamento;iddepartamento=tbBuscar[@deporigen]).departamento;
            "Prov Origen";LookUp(tbprovincia;idprovincia=tbBuscar[@provorigen]).provincia;
            "Dist Origen";LookUp(tbdistrito;iddistrito=tbBuscar[@distorigen]).distrito;
            "Dep Destino";LookUp(tbdepartamento;iddepartamento=tbBuscar[@depdestino]).departamento;
            "Prov Destino";LookUp(tbprovincia;idprovincia=tbBuscar[@provdestino]).provincia;
            "Dist Destino";LookUp(tbdistrito;iddistrito=tbBuscar[@distdestino]).distrito;
            "Moneda";LookUp(tbmoneda;idmoneda=tbBuscar[@idmoneda]).moneda
)

Thank you very much @timl , it works fine now. One last query. How can I make my search case insensitive?

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,781)