Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Possibility to import data from MySQL DB into Dynamics 365 -> Leads using a PHP script

(1) ShareShare
ReportReport
Posted on by 5

Hi,

Do we have possibility to import data from MySQL DB into Dynamics 365 -> Leads using a PHP script

We are capturing enquiries using 'form submission feature' available in our web application. These data will be stored in our MySQL DB in our online server. We are trying to import them.

Thank you

  • MichaelTomar Profile Picture
    65 on at
    RE: Possibility to import data from MySQL DB into Dynamics 365 -> Leads using a PHP script

    As an alternative, you can use a 3rd party tool to integrate MySQL with Dynamics 365. Try Skyvia -  it is a no-code data integration product with a freemium model.

  • sierra-cbe Profile Picture
    5 on at
    RE: Possibility to import data from MySQL DB into Dynamics 365 -> Leads using a PHP script

    Hi,

    We tried postman calls as you suggested. We  tried as in this link https://dynamics-chronicles.com/article/tutorial-how-connect-step-step-d365-postman.

    We registered a new dynamics 365 App but while creating ‘Environment’ got alert as 'You do not have permission to perform this action' . Please refer this doc    for the screen shots

    Please suggest is this related to my account in https://sierratec.crm5.dynamics.com/  

     

    Thank you

  • Suggested answer
    Wahaj Rashid Profile Picture
    11,321 on at
    RE: Possibility to import data from MySQL DB into Dynamics 365 -> Leads using a PHP script

    Hi,

    Seems like the either WebAPI URL is not correct or your are using wrong entity name.

    You can get the correct WebAPI URL using following steps:

    • Got to Advanced Settings -> Customization -> Developer Resources.
    • You will find the the Web API URL under Connect your apps to this instance of Dynamics 365 section:

    pastedimage1612860368325v1.png

    Please note, you need to provide correct version as well.

    Furthermore, you can download the OData Metadata to get the correct dataset name.

    Pleas note, normally, dataset names are in plural, for example contact is accessed using contacts:

    https://<your-org>.api.crm4.dynamics.com/api/data/v9.2/contacts

    I would also recommend you to look at following libraries for PHP to make things easier:

    https://github.com/AlexaCRM/dynamics-webapi-toolkit

    https://github.com/saintsystems/dynamics-sdk-php

    Also, you can first use Postman to test your calls, to setup a Postman Environment with D365, see following:

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/webapi/setup-postman-environment

  • sierra-cbe Profile Picture
    5 on at
    RE: Possibility to import data from MySQL DB into Dynamics 365 -> Leads using a PHP script

    Hi,

    Thanks for your support.

    We have decided to use WebAPI to create leads using a web application

    We tried the PHP script as in https://stackoverflow.com/questions/41215067/trying-to-create-lead-in-dynamics-crm-using-api-in-php. We hosted this in our web application  https://www.efacility.in/webapi-php-crm.php.

    But we are getting the status code as '401'

    Could you please suggest.

    Thanks

  • Suggested answer
    Wahaj Rashid Profile Picture
    11,321 on at
    RE: Possibility to import data from MySQL DB into Dynamics 365 -> Leads using a PHP script

    Hi,

    • Manual Import: if you mean to say manually importing leads from a Excel/CSV file, for that you won't use Flow, for bulk imports, you can use Data Import Functionality of Dynamics 365:

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/basics/import-accounts-leads-other-data

    • Pricing: Microsoft Flow Limited comes with Dynamics 365 Licenses, you do not need extra license unless you overuse the provided limit (calls). Here you can see call limits as per your plan:

    https://docs.microsoft.com/en-us/power-platform/admin/api-request-limits-allocations

  • sierra-cbe Profile Picture
    5 on at
    RE: Possibility to import data from MySQL DB into Dynamics 365 -> Leads using a PHP script

    Hi,

    I have one more query. Could you please suggest.

    Whether pricing involved in PowerAutomate solution as in this link flow.microsoft.com/.../

    Thank you

  • sierra-cbe Profile Picture
    5 on at
    RE: Possibility to import data from MySQL DB into Dynamics 365 -> Leads using a PHP script

    Hi,

    Thanks for your support. We will check PowerAutomate solution as you suggested.

    We understand that  after set ting up the PowerAutomate solution we will still have the possibility to do manual entry also. Please confirm.

    Thank you

  • Suggested answer
    Wahaj Rashid Profile Picture
    11,321 on at
    RE: Possibility to import data from MySQL DB into Dynamics 365 -> Leads using a PHP script

    Hi,

    Thank you for your query.

    There are multiple solutions:

    • No Code Solution: use Power Automate to Retrieve data from MySQL and insert it in Dynamics 365. Power Automate has connectors for both MySQL (premium, paid) and Common Data Service (Dynamics 365).

    Example:

    https://powerobjects.com/flow/using-flow-to-create-dynamics-records-using-a-scheduled-flow/

    • WebAPI: use Dynamics 365 Web APIs (OData) to create records. You can call these APIs from your PHP app.

    https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/create-entity-web-api

    https://github.com/AlexaCRM/php-crm-toolkit

    • ETL: you can use ETL tools like SSIS to read data from MySQL and load it to Dynamics 365 using WebAPI or connectors like Kingsway Soft (paid).

    https://www.kingswaysoft.com/products/ssis-integration-toolkit-for-microsoft-dynamics-365

    • Files: export data from MySQL to a flat file and use Data Import of Dynamics 365.

    https://docs.microsoft.com/en-us/power-platform/admin/import-data-all-record-types

    If you have licenses and data volume is not too high, I would suggest using PowerAutomate (no-code solution).

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,013 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans