locked
Is it possible to trigger a workflow only when the record being created has been imported? RRS feed

  • Question

  • I am importing a bunch of records to the contacts entity, but also have an application entity and when the record is being imported want to create a record in application as well, but only when the record is created by import and not when the contact record is created through the UI. Is this possible?

    Thanks,

    Dave Mackey

    Monday, January 21, 2013 2:40 PM

Answers

  • Hi,

    Add a bool field in your entity and set the bool field only at the import - in your workflow you can check the bool field and if it's true you execute the workflow steps!

    Best regards,

    Andreas


    Andreas Buchinger
    Microsoft Dynamics Certified Technology Specialist
    MCPD: SharePoint Developer 2010

    • Proposed as answer by Andreas Buchinger Monday, January 21, 2013 3:47 PM
    • Marked as answer by davidshq Tuesday, January 22, 2013 6:38 PM
    Monday, January 21, 2013 3:47 PM

All replies

  • Hi,

    Add a bool field in your entity and set the bool field only at the import - in your workflow you can check the bool field and if it's true you execute the workflow steps!

    Best regards,

    Andreas


    Andreas Buchinger
    Microsoft Dynamics Certified Technology Specialist
    MCPD: SharePoint Developer 2010

    • Proposed as answer by Andreas Buchinger Monday, January 21, 2013 3:47 PM
    • Marked as answer by davidshq Tuesday, January 22, 2013 6:38 PM
    Monday, January 21, 2013 3:47 PM
  • To be clear, you can't stop the workflow being run for every single Contact which is created, but you could put in a condition to stop the workflow before it does anything very much (there will still be a performance hit when you import a load of records). Insert a step at the beginning of the workflow which checks the condition "If Contact > ImportSequenceNumber > Does NOT contain data" and then add a "Stop workflow", so if the record was not imported (which uses this field), then do nothing. Leave your existing steps as they are.


    Hope this helps.
    Adam Vero, Microsoft Certified Trainer | Microsoft Community Contributor 2011
    Blog: Getting IT Right

    • Proposed as answer by Adam Vero Tuesday, January 22, 2013 1:35 AM
    Tuesday, January 22, 2013 1:35 AM
  • You don't need a custom Boolean field, just use "ImportSequenceNumber" which is already built in, which avoids the possibility of someone forgetting to populate a custom field as part of their data import process next time round.

    Annoyingly you can use ImportSequenceNumber in an Advanced Find, and in a workflow condition, but you can't get at the values at all such as to add it as a results column in a view / AF, but it should suit the purpose here perfectly.


    Hope this helps.
    Adam Vero, Microsoft Certified Trainer | Microsoft Community Contributor 2011
    Blog: Getting IT Right

    Wednesday, January 23, 2013 1:02 AM