Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

D365 Marketing Form hosted in External website in Multiple Languages

(0) ShareShare
ReportReport
Posted on by 230

Greetings !

Background: I am working on D365 Marketing form that would be hosted in an external website. My customers' website has their pages displayed in native languages based on Country.

Requirement: I need to create the marketing form in the below 4 languages

website.com/en-IN

website.com/fr-FR

website.com/de-DE

website.com/ar-AE

 

Do I have to create the D365 Marketing form from the scratch 4 times or is there a easier way to replicate my form 4 times and then change the labels of each of the D365 Marketing form in the respective language?

In my form, I have two options sets that are dependent on each other and have about 130 combinations and this is the primary reason why I would like to avoid manually creating the same form 4 times.

What is the best approach to achieve this?

Thanks,

Shyam

  • cloflyMao Profile Picture
    25,208 on at
    RE: D365 Marketing Form hosted in External website in Multiple Languages

    Hi Shyam,

    It is very glad that my answer could help you.

    Regards,

    Clofly

  • dxshyam Profile Picture
    230 on at
    RE: D365 Marketing Form hosted in External website in Multiple Languages

    Hi Clofly,

    I was able to create the template, configure the dependent option sets and have them replicated on multiple forms.

    Thank you for the idea.

    Regards,

    Shyam

  • dxshyam Profile Picture
    230 on at
    RE: D365 Marketing Form hosted in External website in Multiple Languages

    Hi Clofly,

    This is an excellent idea, I'll try this over the weekend and let you know.

    Thanks

    Shyam

  • Verified answer
    cloflyMao Profile Picture
    25,208 on at
    RE: D365 Marketing Form hosted in External website in Multiple Languages

    Hi Shyam,

    Thanks for sharing this new feature, actually I have never experienced it.

    I created two option set fields and follow steps from your guidance, now I reproduced your issue.

    As a solution, we could set association in form template, then the association will be reusable for all new form records.

    (My testing two option set fields are: Continent and Country)

    pastedimage1593761496967v2.png

    The parent node will be set by default.

    pastedimage1593761631622v3.png

    pastedimage1593761655546v4.png

    Regards,

    Clofly

  • dxshyam Profile Picture
    230 on at
    RE: D365 Marketing Form hosted in External website in Multiple Languages

    Hi Clofly,

    I have used the out of box feature to associate the two option sets, there is no issue in performance at run time. The issue is only during the design time while associating the two option sets.

    I am not familiar with coding/JS so I try to use the out of box features wherever possible.

    Following are the steps used for associating the option sets

    1) Select the Child Optionset and from properties choose Filter by option to select the parent Optionset. Then Click on the Set up relationship button

    pastedimage1593752849283v1.png

    2) I have associated "Internet" and "Radio" to its associated child optionsets

    pastedimage1593752973223v2.png

    3) Once you execute the form you could see the optionsets behave as per our association.

    4) Parent Option Set Radio was associated to Radio Station, so we see only that option

    pastedimage1593753102251v3.png

    5) Parent Optionset "Internet" was associated with the below 3 Child Optionsets, so we see only those options listed

    pastedimage1593753168270v4.png

    Regards,

    Shyam

  • cloflyMao Profile Picture
    25,208 on at
    RE: D365 Marketing Form hosted in External website in Multiple Languages

    Hi Shyam,

    Could you share me how did you add those two associated option sets?

    It the performance is slow, you could switch to JavaScript.

    Regards,

    Clofly

  • dxshyam Profile Picture
    230 on at
    RE: D365 Marketing Form hosted in External website in Multiple Languages

    Hi Clofly,

    I tried this and was able to replicate my forms, but the association established between two option sets I have (category - 7 values) and (sub-category 131 values) is not established after creating copies using template.

    The association between Category option set and Sub-Category option set took quiet a lot of time and it was pretty slow. is there a way to have the relation between Category, Sub-Category carry forward from one form to another when it is copied?

    Like instead of seeing only the related subcategory, I get to see the complete list of 131 values in the new form. any way to avoid manually associating these categories over and again for each form?

    pastedimage1593748439729v1.png

    Thanks,

    Shyam

  • Verified answer
    cloflyMao Profile Picture
    25,208 on at
    RE: D365 Marketing Form hosted in External website in Multiple Languages

    Hi Shyam,

    You could copy HTML source code of the first form, then save it as a form template.

    6761.JPG

    pastedimage1593740350559v1.png

    After saved the template, active it.

    pastedimage1593740743036v1.png

    Now we can re-use the form and change labels of each form to different languages.

    (There is a "Language" field, but it is only used to help users to filter the template gallery based on this value to make it easier to find the right template.)

    pastedimage1593740504988v3.png 

    pastedimage1593740630797v4.png

    Regards,

    Clofly

  • dxshyam Profile Picture
    230 on at
    RE: D365 Marketing Form hosted in External website in Multiple Languages

    Hi Clofly,

    How do we make copy of a form? I don't see an option in my system.

    This is how my menu looks when I select a form in Marketing form view

    pastedimage1593710176251v1.png

    This is how my menu looks like when I open a form

    pastedimage1593710577955v2.png

    In both the cases I do not see a "Save As" button

    Thanks,

    Shyam

  • cloflyMao Profile Picture
    25,208 on at
    RE: D365 Marketing Form hosted in External website in Multiple Languages

    Hi Shyam,

    You could create 3 copies of the first marketing form, then change fields label to corresponding language for each form.

    e.g:

    By default, there are already 3 form fields: First Name, Last Name and E-mail.

    In second form, we can just change their label to different language.

    pastedimage1593672247753v1.png

    Live result 

    1 English

    pastedimage1593672299169v2.png

    2 French

    pastedimage1593672332740v3.png

    Another solution is to translate label text by javascript.

    In marketing form, field label is rendered in Label tag, so our javascript function process is below:

    1. Fire our custom function after form is loaded. (Check how to use Marketing form API here.)

    2. Detect browser language of user by navigator.language function.(This table listed all possible return result in its Code column.)

    3. Create multiple arrays to save translation text, each array is for one language.

    4. Change label text to corresponding language by switch statement.

    You could add code(jQury version) below to your marketing page to test whether it could work for you.(Change your browser language to French to test.)

    MsCrmMkt.MsCrmFormLoader.on('afterFormLoad', function (event) {
    
        // detect browser language 
        var currentLanguage = navigator.language.toLowerCase();
    
        // Create an array to save translation text, each array is for one language
        var frTranslation = ['Prénom', 'Nom de famille', 'Courriel'];
    
        /**
         *  add other translation text
         *  var deTranslation = ['', '', '']; ....
         */
    
        // Field label is rendered in Label element.
        var totalLabel = $('label').length;
    
        switch (currentLanguage) {
    
            case 'fr':
            case 'fr-fr':
            case 'fr-ca':
                for (var i = 0; i < totalLabel; i  ) {
                    $('label').eq(i).text(frTranslation[i]);
                }
                break;
    
            case 'de':
            case 'de-de':
            case 'de-ch':
    
                break;
    
            default:
                break;
    
        }
    
    });

    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,095 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans