Contents

Don’t Waste Your Thank-You Page: Use Dynamic Data to Drive Next-Step Actions

If you’ve worked with Dynamics 365 Customer Insights Journeys, you’ve probably noticed that the default form submission experience - a simple logo and “Thank you” message - often feels underwhelming for users.

You’re not alone 😁 Many teams want something more engaging, more branded, and more helpful than the out-of-the-box version. Luckily, Dynamics 365 allows you to redirect users to a custom thank-you page, giving you full control over design and content.

BEFORE: /posts/dynamic-thank-you-page-dynamics-365/image1.png AFTER: /posts/dynamic-thank-you-page-dynamics-365/image9.png

In this article, we’ll walk through how to quickly create a personalized, dynamic thank-you page - including how to pass form submission data using sessionStorage so you can greet each user with relevant information right after they hit submit.

This idea (using sessionStorage) comes from an article by the great Megan V Walker, worth a read if this topic interests you 👉 Format Session Registration Confirmation Page On Your Own Domain

TL;DR:
Dynamics 365 CI Journeys lets you redirect form submissions to a custom thank-you page.
By saving form data into sessionStorage during onsubmit, you can create a fully personalized thank-you experience that updates instantly - no server calls needed.

Step 1: Build Your Custom Thank-You Page

We’ll continue with the example page I created in Power Pages in my previous article. And as we are using Power Pages, we’ll keep it simple and click on + Page in our Website editor.

/posts/dynamic-thank-you-page-dynamics-365/image3.png
This will open a Copilot option, which I had tried out by writing `Make a Thank You Page to redirect to when a user submits for an event`

The Result is definitely not bad 😎

/posts/dynamic-thank-you-page-dynamics-365/image2.png

Now let’s customize it.

Add dynamic placeholders

Open Edit Code, then we can modify our h1 and h3 tags to add a span tag which we’ll change dynamically. Here is my Page:

<div data-component-theme="portalThemeColor8" class="row sectionBlockLayout" style='padding: 8px; margin: 0px; display: flex; flex-wrap: wrap; min-height: 60vh; background-image: url("/Event-2.jpg"); background-position: center center; background-repeat: no-repeat; background-size: cover;'>
  <div class="container">
    <div class="col-md-12 columnBlockLayout" style="min-width: 250px; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; margin: 120px 0px;">
      <h1 style="text-align: center; color: #ffffff; text-shadow: 2px 2px 4px rgba(0,0,0,0.7);">Thank You, <span data-form-field="firstname">there!</span></h1>
      <h3 style="text-align: center; color: #ffffff; text-shadow: 1px 1px 3px rgba(0,0,0,0.6);">Your registration for the <span data-form-field="event">event</span> was successful.</h3>
    </div>
  </div>
</div>
<div data-component-theme="portalThemeColor" class="row sectionBlockLayout" style="margin: 0px; display: flex; flex-wrap: wrap; min-height: auto; padding: 40px 0px;">
  <div class="container">
    <div class="col-lg-12 columnBlockLayout" style="min-width: 250px; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px;">
      <h2>What Happens Next?</h2>
      <p>We have sent a confirmation email with all the event details to your inbox. Please check your email and add the event to your calendar.</p>
      <button onclick="window.location.href='/'" type="button" value="/" class="button1" style="width: fit-content;">Return to Homepage</button>
    </div>
  </div>
</div>

Add script to update the placeholders

Open the *.customjs.js of the newly created Thank You Page and paste the following javascript that will substitute the dynamic value of page for the variables we will save in the session storage when we submit the form:

document.addEventListener('DOMContentLoaded', function () {
  populateThankYouPageFromSession();
  });

  function populateThankYouPageFromSession(options) {
    const config = Object.assign(
      {
        storageKey: 'ciFormData',
        clearAfterUse: true
      },
      options
    );

    const raw = sessionStorage.getItem(config.storageKey);

    if (!raw) {
      console.warn('No form data found in sessionStorage under key:', config.storageKey);
      return;
    }

    let formData;
    try {
      formData = JSON.parse(raw);
    } catch (error) {
      console.error('Could not parse form data from sessionStorage:', error);
      return;
    }

    const boundElements = document.querySelectorAll('[data-form-field]');
    boundElements.forEach(function (el) {
      const fieldName = el.getAttribute('data-form-field');
      if (!fieldName) return;

      const value = formData[fieldName];

      if (value === undefined || value === null || value === '') {
        return;
      }

      if (el.tagName === 'INPUT' || el.tagName === 'TEXTAREA') {
        el.value = value;
      } else {
        el.textContent = value;
      }
    });

    if (config.clearAfterUse) {
      sessionStorage.removeItem(config.storageKey);
    }
  }

Your page should look like this:

/posts/dynamic-thank-you-page-dynamics-365/image7.png

Step 2: Configure the Form in Customer Insights Journeys

Enable Redirect

Open your event form in CI Journeys and set:

  • Post submission action: Redirect
  • Redirect URL: full URL of your new thank-you page

/posts/dynamic-thank-you-page-dynamics-365/image8.png

⚠️ If your thank-you page is on a different domain than your form, sessionStorage will not persist.
Use localStorage instead if needed.

Save form values into session storage

Edit the HTML of your form and paste the script after the closing </style> tag:

<script>
  document.addEventListener("d365mkt-afterformsubmit", function (event) {
    const detail = event.detail || {};
    const payload = detail.payload || {};

    const eventTitle =
      document.querySelector("h1 .msdynmkt_personalization")?.textContent?.trim() || "";

    const firstname =
      payload.firstname ||
      document.querySelector('input[name="firstname"]')?.value ||
      "";

    const formData = {
      firstname,
      event: eventTitle
    };

    sessionStorage.setItem("ciFormData", JSON.stringify(formData));
  });
</script>

After adding this script is the moment of the truth, cross your fingers, go to your registration page, fill it out and…

/posts/dynamic-thank-you-page-dynamics-365/image1.gif
Now you have a fully dynamic, branded thank-you experience! 😊

CSP Configuration (Power Pages Only)

If the page redirects correctly but does not show the dynamic data, Power Pages may be blocking inline scripts.

In order to solve this, we can adjust our power pages by allowing this, I found a perfect article for this 👉 Power Pages CSP: Starter Settings

Add this to your CSP settings:

script-src 'self' 'unsafe-eval' 'unsafe-inline' https://*.microsoft.com content.powerapps.com https://*.azureedge.net;

/posts/dynamic-thank-you-page-dynamics-365/image10.png
Here we can see the example of how to configure it, as the article says, you can create or edit it.

Conclusion

Upgrading your thank-you page from the out-of-the-box message to a dynamic, branded experience is a small change with a big impact.

By capturing values in sessionStorage during submission and injecting them into Power Pages, you can:

  • Personalize the confirmation
  • Reinforce your brand
  • Guide users to meaningful next steps
  • Reuse this pattern across all CI Journeys forms

It’s a lightweight technique that dramatically improves user experience and makes your event flows feel more polished and intentional.

If you try it out, I’d love to hear how it worked for you, email me or tag me on LinkedIn!