Hi,
I'm using PCF component code in my PowerApps to display the reports.
So, there is one save button and by clicking on that, the reports data have to be save in SQL Server DB table.
I'm trying to connect my PCF component code from SQL Server DB but I'm unable to connect it. And i'm not finding anywhere like how to connect PCF with DB.
If anyone know about how to save Data from PCF code in powerapps please let me know.
Thanks
Hi @DBTS7 ,
Hier are the docs about using the SQL connector inside Canvas Apps: https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/connections/connection-azure-sqldatabase?WT.mc_id=BA-MVP-5004107 (works similar in Custom Pages).
Here is the turorial about creating a dataset PCF for model-driven apps: https://learn.microsoft.com/en-us/power-apps/developer/component-framework/tutorial-create-model-driven-app-dataset-component?WT.mc_id=BA-MVP-5004107
And I have a blog here about saving using the dataset PCF: Editable Dataset PCF: New SDK Methods – Dianamics PCF Lady (wordpress.com)
Hope this helps!
Hi @a33ik ,
could you please elaborate like how I can use plugins?
Is there any docs or any link by which i may take help?
Thanks
Hi @DianaBirkelbach ,
I'm new to PowerApps so I exactly don't know how we can connect.
I tried to understand your logic and I guess we're not using PCF of type Dataset in out PCF code.
Is there any other way by which I can save PCF data(from Canvas apps) to SQL server?
Thanks.
Hi @DBTS7 ,
PCF works best, if you let the platform provide the data for you.
I have a wild idea about how I would approach this:
If you have a PCF of type dataset, it will provide the data for you (Dataverse data you need for the "report").
You can also have a second dataset inside the same PCF, and using a SQL connector you could provide the data to your PCF using PowerFx (a collection containng SQL data).
The dataset has on Canvas Apps also a method which allows to add records to the dataset : https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/dataset/newrecord?WT.mc_id=BA-MVP-5004107. You have there also methods to save the data. So you could save the data to SQL that way.
I must say that I've never tested this kind of approach. All I did was connect a PCF to Excel (inside a Custom Page using the Excel connector), and used the PCF dataset save methods to save the changes to my excel file.
But I don't know if it works with SQL Connector and not so sure if this PCF edit methods are supported for now.
In the SDK I understand that save methods are GA for model-driven apps, but experimental for Canvas Apps: https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/entityrecord?WT.mc_id=BA-MVP-5004107#methods
WarrenBelz
109
Most Valuable Professional
Michael E. Gernaey
82
Super User 2025 Season 1
MS.Ragavendar
72