Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer Insights - Journeys forum

Personalized Pages - How to Display a Field Value

(0) ShareShare
ReportReport
Posted on by

Good afternoon, 

I followed the instructions on this page to create a personalized page: https://docs.microsoft.com/en-us/dynamics365/customer-engagement/marketing/personalized-page-content

However, I get to this line, and I don't know how to proceed. "Use standard JavaScript techniques to reference and use the values."

Can someone provide me a sample of how to display a personalized field value on the page?  What is "standard JavaScript" to do this?  

I've already created the personalized page/fields/javascript and put it into the header.  I'm looking on how to display the values of those fields on the page.

Thanks,

Stephani

  • Suggested answer
    cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Personalized Pages - How to Display a Field Value

    Hi Stephani,

    As per my understanding, you can take fields contained in success callback data for personalized content.

    Yes, innerHTML is a property of DOM element on HTML page, it's can be used to element display customization, to say "Hello, firstname", simply change the content string at right of innerHTML like: "Hello, " + firstname(from data.Data["firstname"]) ...

    We need some basic JavaScript skills to make our personalization.

    Here is how did I add the context to the body content, it will be generated at top of marketing page.

    My personlization is an image will be shown to contact when its city field equals some value, 

     1348.222.png

    Result:

     1348.222.png

    Or you could take callback data to populate fields.

    Regards,

    Clofly

  • Stephani Profile Picture
    Stephani on at
    RE: Personalized Pages - How to Display a Field Value

    Here is where I am confused, I think you used this line to actually display the personalized content right? result.innerHTML = "text" + firstname

    That is in the header right?

    How do I add the personalized text to the body content?  What is the JavaScript or code I need to say "Hello, firstname" in the body of the page?

  • cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Personalized Pages - How to Display a Field Value

    Hi Stephani,

    I've done for a whole process in system landing page. I just display fetched data in a div in the demo.

    Here are my notes, you could take them as reference:

    1. Identification info will be stored in cookies after user's submit, so you should confirm their browse not disable cookies option.

    2. As the bottom sentence in the doc, you need to wait about 30 secs and do not clear cache during this period.

    3. Check whether the generated JavaScript code actually embedded in the head tag after save and go live. (I noticed my code disappeared after first save)

    4. The embedded JS will work for querying the contact record after submission when user open the page again and you can fetch any fields in the previous sub-grid Fields(whitelist field). They are contained in callback data.

    5. Standard JS means you can create any variable to receive callback data and do what you need by native JS code.

    Result:

    1261.222.png

    Code:

    1261.222.png

    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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans