Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

Having selection trigger topic field to be populated with content

(0) ShareShare
ReportReport
Posted on by 15

Hello,

I am migrating our current forms from Gravity forms integrated into our Dynamics CRM to Dynamics Marketing. We currently have a form that has radio buttons with different options. When the user selects one of the radio button options, it triggers whatever item they choose to populate a hidden field under "Topic" in our CRM. 

I need help on how to accomplish this using Dynamics Marketing please.

Thanks,

Mariah

  • mariahmays21 Profile Picture
    mariahmays21 15 on at
    RE: Having selection trigger topic field to be populated with content

    Yes, thank you. It did work for us!

  • cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Having selection trigger topic field to be populated with content

    Hi Mariah,

    Could it work for you?

    Regards,

    Clofly

    If you had found any answer helped, please kindly mark as verified to close the thread, it would be really appreciated.

  • Verified answer
    cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Having selection trigger topic field to be populated with content

    Hi Mariah,

    In Dynamics Marketing, we can accomplish it with javascript.

    The script will execute after form is rendered.

    MsCrmMkt.MsCrmFormLoader.on('afterFormLoad', function (event) {
        var radiobtnList = document.querySelectorAll('input[type="radio"]');
        for (var i = 0; i < radiobtnList.length; i  ) {
            radiobtnList[i].addEventListener('change', function () {
                if (this.checked) {
                    document.getElementsByTagName("input")[0].value = this.nextSibling.innerText;
                }
            })
        }
    })

    In my marketing form, the Topic field is the first field, so index number of document.getElementsByTagName("input")[0.value is 0, please adjust the number based on your environment.

    pastedimage1594711543166v1.png

    Result:

    The topic field of new lead has been set to text of checked radio button option.

    pastedimage1594711751655v2.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

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,160 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans