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 / Writing SQL data rows ...
Power Apps
Unanswered

Writing SQL data rows into dataverse table by hitting a command bar button

(0) ShareShare
ReportReport
Posted on by

Hey y'all,

 

we would like to sync some sql data on-demand into dataverse tables as child records.

The scenario is:

The user is in the form of a record in a model driven app. The record has child records shown in a subgrid. The user wants to refresh the child records from a sql database, so that all of the missing data rows will be written into the dataverse table for the child records and connected via lookup to the parent record.

We use the following setup: An Azure function that requests the data via Hybrid Connection Manager from On-Premises SQL database.

Now we need the ad-hoc request by hitting a command bar button. How would you solve this? We need to request the Azure Function by hitting the button and the Azure Function (or a plugin?!) needs to write data to the dataverse table. After writing all of the data, the form should refresh with the newly created child records in a subgrid.

 

Thanks in advance for your ideas 🙂

I have the same question (0)
  • manojpatel20dec Profile Picture
    17 on at

    @Anonymous here's a simplest approach that I would have done:

    - Install On-Premise data gateway on your sql machine and register it Use the on-premises data gateway app | Microsoft Learn

     

    Sign-In with your dynamics AD account

     

    - Create a instant flow, use action either execute SQL query or stored procedure

    - Configure the connection details to be windows/ SQL authentication and select the gateway you configured previously

    manojpatel20dec_0-1680199150306.png

    -Enter the sql query/ procedure

    -use request response and return the query results from previous action as json string

    manojpatel20dec_1-1680199592612.png

     

    - Save the flow and get the http URL

    - Create a webresource with a function to call http flow url and get response json back, parse json object and loop through the data and create it as records setting the current lookup too, on completion call

    formContext.data.refresh(save).then(successCallback, errorCallback);

    -Use ribbon workbench and call the webresource method on custom button to sync DB records

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard