Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Answered

Scheduled Call to External API for Create/UPdate Records in D365

Posted on by 170

Hi,

My Requirement is to call External API..[Scheduled one] (say 3 times a day). Based upon the response, I`ll loop through the D365 Records to Create/ Update Accounts or Contacts . Can anyone please suggest me the steps to achieve this without using Microsoft Flow(Power Automate).

Using Flow would work, but no. of API Calls will be more I guess, Also data coming from API would be huge.

Thanks in advance!

  • Pete QD Profile Picture
    Pete QD 10 on at
    RE: Scheduled Call to External API for Create/UPdate Records in D365

    Hi Wahaj, I have not understanded how to create the scheduled Flow for option 1. The provide link only use JS code to call custom action, not scheduled.

    Many Thanks.

  • Wahaj Rashid Profile Picture
    Wahaj Rashid 11,319 on at
    RE: Scheduled Call to External API for Create/UPdate Records in D365

    You are welcome.

    Feel free to discuss if you face any issue.

  • RE: Scheduled Call to External API for Create/UPdate Records in D365

    Thanks Wahaj,

    I'll try this out

  • Verified answer
    Wahaj Rashid Profile Picture
    Wahaj Rashid 11,319 on at
    RE: Scheduled Call to External API for Create/UPdate Records in D365

    Yes that's correct.

    You need to call the API and do your CRUD logic within Action.

    You can call External APIs within custom code activity or a plugin (same way):

    https://msdynamicscrmblog.wordpress.com/2017/11/06/call-external-cross-domain-rest-apisoap-service-from-crm-pluginscustom-workflows/

  • RE: Scheduled Call to External API for Create/UPdate Records in D365

    Thanks Wahaj for the solutions listed,

    As per Solution 1 - can you please brief me where to call External API?

    In custom Action or Plugin?

    Calling API n Create/Update logic will that all go into Custom Actions?

  • Suggested answer
    Wahaj Rashid Profile Picture
    Wahaj Rashid 11,319 on at
    RE: Scheduled Call to External API for Create/UPdate Records in D365

    Hi,

    Thank you for your query.

    There is no out-of-the-box scheduling functionality available in Dynamics 365.

    As a workaround, I would suggest following:

    • Create a custom action, call external API and create CRM records in a loop.
    • Then, call this custom action using a scheduled Flow. Please note, it will be one call per schedule (3 flow calls in your scenario), because actual API call and record creation is done within custom action (not flow). Here is a blogpost to give you an idea on custom actions and calling it through WebAPI (or Flow):

    https://carldesouza.com/creating-a-custom-action-and-calling-it-from-web-api-in-dynamics-365-power-apps/

    • If you do not want to use flow at all, you can write a console app which calls this action using WebAPI, then schedule this app in Window Task Scheduler (not an elegant solution but works).
    • Last, which I do not prefer, but there are ways to schedule workflows, look at the following post:

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/225758/how-to-schedule-job-or-workflow

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans