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 / SQL Query to powerapps
Power Apps
Answered

SQL Query to powerapps

(0) ShareShare
ReportReport
Posted on by 411

Hello community.

 

Is it possible to make the next SQL query into powerapps 

 

SELECT 
P.planta as Planta,
C.[nombre_cliente] as Cliente,
 EIG.[ID_INFORMACION],
AMS.FOLIO_COTIZACION + ' - ' + EIG.Part_Description as [FOLIO_COTIZACION],
AMS.ANIO,
AMS.MES,
AMS.DESCRIPCION,
 AMS.NUM_RECLAMOS_OF,
 AMS.NUM_RECLAMOS_NOF
FROM 
[PCP_ALERTAS_AMS] as AMS
LEFT JOIN EPCP_INFORMACION_GENERAL as EIG ON EIG.[ID_INFORMACION] = AMS.ID_INFORMACION
left join [dbo].[COT_CLIENTES] AS C on EIG.id_cliente = C.[id_cliente]
left join [DW_PCP].[dbo].[COT_PLANTAS] as P on P.id_planta = EIG.PCPPlant

 

I´ve tried to do it, but im getting some trouble with AddColumns 

 

 

 

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    You can't run SQL Select queries directly from Power Apps. You can use a Flow to run the query and return the data.

  • HectorOlivos Profile Picture
    411 on at

    So working with power automate is way more optimal, thanks for the advice.

     

    However I´ve tried using the next formula 

     

    ClearCollect(
     colGridData,
     AddColumns(
     AddColumns(
     PCP_ALERTAS_AMS As AMS,
     "id_planta_p",
     LookUp(
     EPCP_INFORMACION_GENERAL,
     FOLIO_COTIZACION = AMS.FOLIO_COTIZACION,
     PCPPlant
     ),
     "id_cliente_c",
     LookUp(
     EPCP_INFORMACION_GENERAL,
     FOLIO_COTIZACION = AMS.FOLIO_COTIZACION,
     id_cliente
     )
     ),
     "Planta",
     LookUp(
     COT_PLANTAS,
     id_planta = id_planta_p,
     planta
     )
     ,
     "Cliente",
     LookUp(
     COT_CLIENTES,
     id_cliente = id_cliente_c,
     nombre_cliente
     )
     )
    )

     

    This is only to show in gallery.

    But sometimes the formula loads everything and sometimes it dont. 

     

     

  • Verified answer
    HectorOlivos Profile Picture
    411 on at

    I just created a SQL View to make it more simple, and used it as datasource for the gallery 

    😊

     

     

     

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard