web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Using Power Automate to initiate importing records

(0) ShareShare
ReportReport
Posted on by 50

I have a need to regularly import files into Dynamics (at least 4-5 times a day). I would use the standard "add a row" connector on Dataverse, however there will be a large number of duplicates in each file, so it is time consuming to deduplicate in Power Automate - as creating via Power Automate appears to bypass all duplicate detection rules that are normally applied when importing.

I'd quite like to automate this, but don't have the capability with C# to write a plugin that does it (and I want to work with sharepoint as a source), so was considering Power Automate.

I have set up a flow that does:

  1. Create Data Import (import) record
  2. Create Import Source File (importfile) record with the source file from a Sharepoint source (as comma separated values)
  3. Initiate a ParseImport action using the importid
  4. Wait for the parse to complete (monitor the System Jobs table)
  5. Initiate a TransformImport action using the importid
  6. Wait for the transform to complete (monitor the System Jobs table)
  7. Initiate an ImportRecordsImport action using the importid

This however fails to complete the import, and I can't find anywhere to look at logs for why it is failing.

Each of the three system jobs succeed (as they would with a normal import), and the importfile record shows the correct number of rows, headers etc (so appears to be parsed correctly).

I suspect my issue stems from missing a key parameter or step in this process - can anyone advise? Or suggest an alternative (free) option? My source data is fairly flexible in storage location/format.

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Using Power Automate to initiate importing records

    Hi SBeal,

    Can you provide some screenshots about it?

  • SBeal Profile Picture
    50 on at
    RE: Using Power Automate to initiate importing records

    Screenshots below:

    1. pastedimage1633513293901v1.png
    2. pastedimage1633513322969v2.pngpastedimage1633513333715v3.png
    3. pastedimage1633513362175v4.png where "import" = importid from action 1 for this and all below actions
    4. pastedimage1633513403860v5.png
    5. pastedimage1633513419047v6.png

    On the system job entity all jobs completed:
    pastedimage1633513657042v7.png

    On the importfile record:

    pastedimage1633513681802v8.png

    pastedimage1633513693654v9.png

  • Alan Roberts Profile Picture
    on at
    RE: Using Power Automate to initiate importing records

    Hi SBeal, I have a similar requirement, did you ever manage to get this working?

    Thanks

    Alan

  • SBeal Profile Picture
    50 on at
    RE: Using Power Automate to initiate importing records

    Unfortunately no, my requirements changed so I gave up on it.

    My last thoughts was that I somehow needed to get the result of the transform file action and pass it to the import record import action, but I couldn't work out how to do that, or where the data might be "stored" (if it was possible). The other possibility is that you pass the original data to the import record import action and based off the transform results it converts it on the fly.

    There is fairly sparse documentation for these actions on Microsoft's knowledge base unfortunately.

  • Alan Roberts Profile Picture
    on at
    RE: Using Power Automate to initiate importing records

    Thanks anyway.  Somehow I've managed to get it working, but I'm not sure what tweak was the answer.

  • SBeal Profile Picture
    50 on at
    RE: Using Power Automate to initiate importing records

    Oh interesting - would be interested in seeing your flow steps/code to see if I can replicate!

  • Suggested answer
    Alan Roberts Profile Picture
    on at
    RE: Using Power Automate to initiate importing records

    Very similar to yours really

    1. Setup the import
    3482.step1.png

    2. Set up the file
    5383.step2.png

    I'm just passing the content in from a compose as a test
    Step2b.png

    I am using an existing map with TargetEntityName and SourceEntityName matching the ones above
    step2c.png

    If the SourceEntityName doesn't match the import will fail

    3. Parse the file (Dataverse Connector/Perform a Bound Action/Data Imports table/ParseImport)
    1018.Step3.png

    Then loop checking the system jobs until complete (statecode 3 as per https://docs.microsoft.com/en-us/power-apps/developer/data-platform/webapi/reference/asyncoperation?view=dataverse-latest)
    Stage3b.png

    4. Do a similar thing with the transform  (Dataverse Connector/Unbound Action/TransformImport)
    5367.step4.png
    again looping and checking system jobs for completion

    5. Import the transformed file  (Dataverse Connector/Perform a Bound Action/Data Imports table/ImportRecordsImport)
    step5.png


  • Suggested answer
    SBeal Profile Picture
    50 on at
    RE: Using Power Automate to initiate importing records

    Thanks Alan, the key bit I was missing was setting the SourceEntity of the importfile record to be the same as the chosen importmap.

    It now works seamlessly!

  • Alan Roberts Profile Picture
    on at
    RE: Using Power Automate to initiate importing records

    Glad to hear it is working.  That was the only part I could see where the problem might have been!

  • Abeer Profile Picture
    5 on at
    RE: Using Power Automate to initiate importing records

    Alan Roberts Thank you for sharing this but I didn't get how did you do the mapping tags

    <entitymap targetEntity="int_location" sourceentityname="location7" dedupe="ignore" procesCode="Process">

    please if you could help!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 77 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 57 Most Valuable Professional

#3
Anthony Blake Profile Picture

Anthony Blake 43 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans