web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
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

I have the same question (0)
  • Verified answer
    cloflyMao Profile Picture
    25,210 on at

    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

  • cloflyMao Profile Picture
    25,210 on at

    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.

  • mariahmays21 Profile Picture
    15 on at

    Yes, thank you. It did work for us!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 144 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 59

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans