Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

How to make a dropdown list from text field in dynamic CRM

Posted on by 70

Hi I have a requirement that I have a course Column in my entity which i want to make as simple single Line Text field , but when someone enter the course like I entered Mathmatics so when next time i open up the form this field should appear as dropdown and have the values which i have added previously mathmatics in this case , and if i add physics now and on next time when i open up the form i should be able to see both Mathmatics and physics and so on....

can someone assists me how to achieve that in dynamic365 CRM

  • MalikDanish  Profile Picture
    MalikDanish 70 on at
    RE: How to make a dropdown list from text field in dynamic CRM

    A dropdown previously configured with its respective options is possible, however a dropdown from a text field is not possible.

    I can have a dropdown but I would like to allow user to populate values in it.

  • Suggested answer
    Inogic Profile Picture
    Inogic 24,094 on at
    RE: How to make a dropdown list from text field in dynamic CRM

    Hi,

    To achieve your requirement, you need to write custom code (plugin) and create two fields - 1. Single line text (Subject_String)   2. Option set (Subject). Option set value will be the final value for the subject.
     
    2502.image008.jpg
     
    Users can enter a value in the text field or Option set. If the user selected an option in the option set then no action needed, but when the user entered the value in a text field, in background code will trigger and add an option as a text field value to the option set and clear the text field value.
     
    Code should trigger on record save and update of the subject text field.
     
    In code, check if text field value is available in the option set then set the option as the selected value. Exit code.
     
    If text field value contains data and entered text does not exist in option set then add logic to add new option as text field value to option set. Also, set the newly added option as the selected value for the option set and then clear the text field value.
     
    You can refer to the below link to add value to the options set: 
     
    Hope this helps!
  • Sandesh G Profile Picture
    Sandesh G 30 on at
    RE: How to make a dropdown list from text field in dynamic CRM

    Hi MalikDanish,

    In this case you can have separate Entity to hold the course values with all possible values you have beforehand.

    Next step would be to have singleline field on your form, with autocomplete and source as lookup to above entity.

    On-change of above field you can have a js to check if it's new or existing value, and store in some temp variable.

    Later you can write plug-in or MS-flow(powerAutomate) to insert if it's new value based on above temp variable.

  • MalikDanish  Profile Picture
    MalikDanish 70 on at
    RE: How to make a dropdown list from text field in dynamic CRM

    Basically I do not want an admin to have the control to add new items and use it as dropdown I want what ever the  user type and saved for every next time it would be available into the list .

  • Suggested answer
    Fubar Profile Picture
    Fubar 2,752 on at
    RE: How to make a dropdown list from text field in dynamic CRM

    You could do it, but you would have to write a PCF Control to do it (or a Web Resource with custom JS)

    But, would question why you wouldn't just use a Lookup and give the user privileges to create new items..

  • RE: How to make a dropdown list from text field in dynamic CRM

    Hello,

    A dropdown previously configured with its respective options is possible, however a dropdown from a text field is not possible.

    You could: Create a table (entity) where users can create records with the necessary Subject as input.

    i.e. Mathematics, Physics

    Thanks!

    Community Support Team - Esteban

    If this Post helps, then please consider Accept as solution to help the other members find it more quickly.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans