• Resolved siddiquemahsud

    (@siddiquemahsud)


    Is there a way to dynamically populate the optionset fields (marked bold in the below form)?

    [msdyncrm_twig]
    
    {% form entity="contact" mode="create" %}
    {% apply spaceless %}
    
    <form id="form-{{ form.id }}" enctype="multipart/form-data" method="post">
    
    <input name="firstname" type="text" placeholder="First Name" />
    <input name="lastname" type="text" placeholder="Last Name" />
    <select name="gendercode">
       <option value="0"> Male </option>
      <option value="1"> Female </option>
    </select>
    <input name="file-1" type="file" />
    <input name="file-2" type="file" />
    <button class="button custombutton" type="Submit">Text me a demo</button>
    <input name="_key" type="hidden" value="{{form.key}}" />
    <input name="__formid" type="hidden" value="1234-6789" /></form>
    
    {% endapply %}
    {% endform %}
    
    [/msdyncrm_twig]

    I have just installed the Dynamics 365 Integration Plugins (free/premium), should i need to install the Dataverse plugin too? (for getting the optionset metadata) if yes, can I i use the dataverse plugin with same liscense i have for dynamics 365 plugin? OR Is there a way to dynamically populate the optionset fields within the dynamics 365 Integration plugin?

Viewing 1 replies (of 1 total)
  • Thread Starter siddiquemahsud

    (@siddiquemahsud)

    Choice columns can be populated as following in Dynamics 365 plugin (1033 is English, if you have other languages installed, you can use those)

    <select>
       {% for optionValue, optionLabel in metadata["contact"].attributes["gendercode"].optionSet.localizedOptions %}
          <option value="{{ optionValue }}">{{ optionLabel[1033] }}</option>
       {% endfor %}
    </select>

    Thanks Alexa team for hte quick support!

Viewing 1 replies (of 1 total)
  • The topic ‘s there a way to dynamically populate the optionset fields’ is closed to new replies.