Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Create Customer journey using power automate

Posted on by

Hi,

I have a requirement to create customer journey dynamically and associate it with segment and marketing email template.

The power automate should create the customer journey on expiry of existing customer journey. Any links or guidance will be helpful

Thanks in advance.

  • Trent Rossini Profile Picture
    Trent Rossini 5 on at
    RE: Create Customer journey using power automate

    Hi Joshua

    FYI, if you want an enteprise strength customer journey solution that works with Power Automate, see www.inquba.com/.../

    Regards

    Trent

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Create Customer journey using power automate

    Clofly

       msdyncrm_contentsettingss([existing record content settings]) was a life saver I was banging my head trying to figure that part out..

    I am successfully creating a Segment & Customer Journey via Flow (Yah!)

    However, when the Journey runs, the contacts in the segment are not getting processed... The Journey keeps saying that it stopped processing those contacts (see image)..

    Any thoughts on why a live static segment with a contact on a live journey would not process the contacts?

    pastedimage1607572856191v1.png

  • Satish Ashy Profile Picture
    Satish Ashy on at
    RE: Create Customer journey using power automate

    Thanks for the response I shall try out.

  • Suggested answer
    cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: Create Customer journey using power automate

    Hi Satish,

    You could trigger the flow when a customer journey is Stopped(Status reason field), because when a customer journey expires, it will become into stopped status.

    Then create a new journey record from data of the expired record, for example:

    Action properties:(The sample action will create a new journey with same tiles as the expired record has.)

    Name: [existing record name 123

    Start date and time: utcNow()

    End date and time: formatDateTime(addDays(utcnow(),30),'dd-MMMM-yyyy')

    Time zone: [existing record time zone

    Content settings: msdyncrm_contentsettingss/([existing record content settings)

    Status: Active

    Status reason: Draft

    Workflow definition: [existing record workflow definition

    pastedimage1606814043082v1.png

    The most important part is the workflow definition(tiles), it is structured in JSON format, please take some time to learn about it.

    For example, the structure of a simple customer journey will look like below:

    (Segment -> Email)

    pastedimage1606814980614v1.png

    The JSON is stored in msdyncrm_workflowdefinition field of Customer Journey entity.

    [
      {
        "ActivityTypeId": "bpf_root",
        "ParentBranchId": 0,
        "ParentRelationshipType": "Default",
        "ActivityId": "01",
        "Properties": {
          "Items": [
            {
              "ItemId": null,
              "ActivityTypeId": "bpf_root",
              "Title": "Undefined",
              "Name": "New bpf_root",
              "ActivityItemId": 0
            },
            {
              "ItemId": null,
              "ActivityTypeId": "bpf_root",
              "Title": "Undefined",
              "Name": "New bpf_root",
              "ActivityItemId": 1
            }
          ]
        },
        "TileId": "bpf_root",
        "ParentActivityId": null
      },
      {
        "ActivityTypeId": "Segment",
        "Properties": {
          "Items": [
            {
              "ItemId": null,
              "ActivityTypeId": "Segment",
              "Title": null,
              "Name": "New Segment",
              "ActivityItemId": 29,
              "SegmentMergeMethod": "Union",
              "ContainmentMethod": "Inclusion",
              "IsNameSystemDefined": false,
              "Description": null
            },
            {
              "ActivityTypeId": "SegmentItem",
              "ActivityItemId": 30,
              "Name": "Clofly",
              "EntityLogicalName": "msdyncrm_segment",
              "ItemId": "2885c09b-b127-eb11-a813-000d3aa080ec",
              "ContainmentMethod": "Inclusion",
              "DciSegmentName": "SEGMENT_CRM_ID_2885c09bb127eb11a813000d3aa080ec",
              "SegmentDisplayName": "Clofly",
              "SegmentSourceType": "Segment",
              "Title": null,
              "IsNameSystemDefined": false,
              "Description": null
            }
          ]
        },
        "EntityTarget": "contact",
        "TileId": "mktAudience",
        "ParentActivityId": "01",
        "ParentBranchId": 0,
        "ActivityId": "01_6"
      },
      {
        "ActivityTypeId": "Email",
        "Properties": {
          "Items": [
            {
              "ItemId": "8a68c12e-b027-eb11-a813-000d3aa080ec",
              "ActivityTypeId": "Email",
              "Title": null,
              "Name": "11-16-01",
              "ActivityItemId": 38,
              "IsNameSystemDefined": false,
              "Description": null,
              "EntityLogicalName": "msdyncrm_marketingemail",
              "ExpiryEnabled": false,
              "ExpiryDate": "2020-12-01",
              "ExpiryHour": 0,
              "SchedulingConfiguration": null,
              "ABTestConfiguration": null
            }
          ]
        },
        "EntityTarget": "contact",
        "TileId": "email",
        "ParentActivityId": "01_6",
        "ParentBranchId": 0,
        "ParentRelationshipType": "Default",
        "ActivityId": "01_6_8"
      }
    ]

    If you only want to change segment and marketing email to new value:

    In Segment node, replace value of ItemId and DciSegmentName properties with the new.

    In Email node, replace value of ItemId property to the new.

    (DciSegmentName equals to value of msdyncrm_segmentqueryname attribute of segment.)

    In conclusion, please refer to following article to do basic operations on Customer Journey using the API:

    https://docs.microsoft.com/en-us/dynamics365/marketing/developer/basic-operations-on-customer-journey

    Regards,

    Clofly

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans