Skip to main content

Notifications

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

Send vouchers to contacts based on a dynamic segment

(0) ShareShare
ReportReport
Posted on by 877

Hello everyone,

I have created a voucher table that has a relationship with the contact entity of N:1 (Multiple vouchers can be assigned to a single contact). Please correct me if the relationship type is wrong.

The voucher table has the following sample data:

Title: Voucher A, Expiry date: 1/31/2022

The scenario I need to achieve:

  1. I want to send a voucher for a targeted segment that has today's birthdays of our contacts in an Marketing email, and the voucher must be valid by date and not expired.
  2. I would like to know the logs of the vouchers that have been sent to all contacts previously.

For example, if we sent voucher A to a customer on 1/12/2022 and the following year 1/12/2023 we sent them another voucher (voucher B), I want a simple grid in the contact table that shows me these logs.

       3. For logs, do I need to have a separate table between vouchers and contacts for transactions to get the necessary logs? Or is there an OOB feature that already does this? If not, how can I feed the contacts with this data to show the previous vouchers were sent to a specific contact?

I saw a great post that is very similar to my case Send coupon code. However, I still need guidance on the above requirements and would greatly appreciate it if you could provide a useful example or resource that shows how to implement something similar to this case.

Any help is most welcome.

Thank you!

  • EBMRay Profile Picture
    EBMRay 877 on at
    RE: Send vouchers to contacts based on a dynamic segment

    Hello AlexJay ,

    Thank you for your suggestion and apologize for the late reply.
    I built a flow that triggers on daily basis, retrieve from a dynamic segment the list of contacts whose birthday is today, and an action that will create a voucher for each contact during the flow run (on the fly).
    To ensure that the contacts have the vouchers already assigned before the customer journey is triggered I discovered that I can publish the customer journey by updating status = active and status reason = going live.

    Currently, it is not a large data set and the estimated contacts on daily basis are between 100-300. During each run I need to indicate which contacts have already been processed and to overcome this limitation in Power Automate for the API calls I built the below query definition:
    AllToday_2700_sBrithdayContacts.pngEXCEPT.pngQueryView.png
    Joining two lists together based on the above conditions the list will become smaller and smaller until all contacts are processed.
    I still need to add to my query a condition to exclude the records for the contacts that have already Birthday vouchers allocated this year. In that case, any birth voucher that the contact has will be excluded for this year.

    Would highly appreciate it if you can provide a good resource and best practices to work with Power Automate if you have a large data set that you want to perform an update for the records in batches.

    I have changed the relationship from 1:N (1 contact can have many vouchers because I am using power automate that will generate the vouchers and contact might have different voucher types).Hence, in the contact I will have a grid that will show me the vouchers that were previously allocated to any contact.


    Regarding your last point very nice idea, how can we view the historic emails sent to a contact? Is there any documentation on that to check the logs of the historic emails?
    We will definitely create a Power BI report to generate the KPIs needed.


    I look forward to your response.
    Best regards,
    EBMRay

  • AlexJay Profile Picture
    AlexJay 420 on at
    RE: Send vouchers to contacts based on a dynamic segment

    Hi EBMRay,

    I believe the only way to use the standard workflows given they can only update the contact would be to set some field on the contact which triggers another workflow to create the vouchers. Perhaps it is the voucher name you populate to avoid having to create fields for each voucher type as that name can be used in the subsequent workflow, but this isnt a great solution.  Perhaps you could create a task within the customer journey with a certain subject and then have a workflow/flow trigger on create of those specific tasks to then create a voucher record and then close or delete the task. 

    Until we can call power automate from customer journeys (coming soon, though perhaps only for real-time) I would perhaps flip this slightly and get the system to allocate the vouchers first, then that allocation can be part of your dynamics segment query to trigger the email sends (eg contacts associated to a voucher A created today).

    Have power automate run on a schedule to create the vouchers based on the requirements. Check the volumes won’t breach your particular api limits, you may need to look at ways to reduce the batch size such as parallel processing or splitting it out through the day if really high.

    Also seems you really have a N:N relationship between Contacts and vouchers (conceptually). Perhaps the oob N:N might work for you but I tend to create intersect tables, so in this case you might want a table such as “Voucher Allocation” or “Voucher Assignment” to sit between vouchers and contacts, depends on other factors like reporting requirements. 

    The easiest thing to do though would be to consider the voucher emails as the voucher records and view the historic emails sent from the contact to understand if they’d been sent one. I’m sure this probably won’t suffice but perhaps there’s some compromise/pushback to avoid creating a complicated solution but solve it through, say, a PowerBI report referencing those sent emails. 

    hope it helps 

    cheers 

  • EBMRay Profile Picture
    EBMRay 877 on at
    RE: Send vouchers to contacts based on a dynamic segment

    Hi Nya ,

    Thank you for your reply.

    I created a new workflow with the contacts as the target entity and kept the relationship the same 1:N (that means 1 voucher to many contacts).

    In the workflow, I can see the sub-grid of the related vouchers. However, I cannot find the vouchers under the related entities tab so how do I perform an update to the sub-grid to assign for example voucher A for all the targeted contacts? It seems that Dynamics workflows won't achieve my requirements to allocate the vouchers.

    SS.png

    What can we consider instead of the marketing app as a solution for that case since we already have the licenses and we're trying to stick as much as possible to the OOB features?

    I look forward to your response.

    Best regards,
    EBMRay

  • Suggested answer
    Nya Profile Picture
    Nya 29,058 on at
    RE: Send vouchers to contacts based on a dynamic segment

    Hi,

    You cannot change the target entity of the workflow, otherwise it cannot be inserted into the customer journey.

    Because of the change in the relationship between your entities, I don't think the Marketing app is a good choice for this need.

  • EBMRay Profile Picture
    EBMRay 877 on at
    RE: Send vouchers to contacts based on a dynamic segment

    Hello Nya,

    I would greatly appreciate your help with the last query that I raised which shows what I tried.

    I look forward to your response.

    Thank you!

  • EBMRay Profile Picture
    EBMRay 877 on at
    RE: Send vouchers to contacts based on a dynamic segment

    Hello Nya ,

    It seems that I linked the tables (Voucher & Contacts) in the wrong relationship type and I changed it to 1:N ( 1 Voucher can be assigned to many contacts).So in the voucher, I have the lookup field, and in the contacts, I have the sub-grid that will show all the associated vouchers for a specific contact.

    According to your answers, I started with building the workflow by choosing the voucher as my target entity (since the relationship has been changed, and please correct me if am wrong).

    Please find below what I did until now and the concerns that I have:
    1200.Screen1.png

    1. For the options in the automatic processes I should not choose any option because my trigger is the customer journey right?
    Screen2.png

    2. I added a condition to find all the contacts that have a birthday today on the workflow ( for testing purposes I chose 1/17/2022).
    Update-contact.png

    3. Currently, I am stuck on how to assign for example, Voucher A for those contacts retrieved.
    Associate-Contact-with-a-voucher.png

    I would highly appreciate it if you can provide a sample example to create this workflow.

    I look forward to your response.

    Best regards,
    EBMRay

  • EBMRay Profile Picture
    EBMRay 877 on at
    RE: Send vouchers to contacts based on a dynamic segment

    Hi Nya ,

    Thank you for your prompt response.

    How can I link the workflow to generate the records from the dynamic segment that will fetch the contact's data?

    The customer journey is already related to the dynamic segment needed.

    I look forward to your response.

    Thank you!

  • Nya Profile Picture
    Nya 29,058 on at
    RE: Send vouchers to contacts based on a dynamic segment

    Hi EBMRay,

    You don't need to be concerned about the number of rows as the workflow in the customer journey will handle all the contacts in the audience of the journey.

  • EBMRay Profile Picture
    EBMRay 877 on at
    RE: Send vouchers to contacts based on a dynamic segment

    Hi Nya ,

    Thank you very much for providing screenshots.

    What is the recommended number of rows for bulk updates during the workflow run?

    I will try all the steps mentioned in this article and get back to you if I have any problems.

    Best regards,

    EBMRay

  • Suggested answer
    Nya Profile Picture
    Nya 29,058 on at
    RE: Send vouchers to contacts based on a dynamic segment

    Hi EBMRay,

    There is a workflow tile in Customer Journey which can select on-demand workflows targeting at Contact entity.

    pastedimage1642145343755v1.png

    pastedimage1642145355505v2.png

    You can set the journey as a recurring one so that you can trigger the flow every day at 6:00 AM.

    Set up a recurring journey

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans