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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to set option set ...
Power Apps
Unanswered

How to set option set value based on the value getting from text field using plugin?

(0) ShareShare
ReportReport
Posted on by

Hello everyone, 

 

I have two fields in my table

1. Reason - text

2. ReasonCode - optionSet

 

I have written plugin which will trigger on record creation, I want to set value for Reasoncode based on the value in Reason field.

 

I have around 35 options in the Reasoncode. Is there any other way I can do this rather than using 35 if or case conditions?

 

Thank you... 

I have the same question (0)
  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hello @Anonymous,

     

    As per your scenario, we need to use if..else or Switch Case to achive this Scinatio in PreCreate Operation there is no other way.

     

    My Suggestion will be, if we are having with in 10 values its good to go with Optionset Value else its good to go with Lookup(by creating custom table)

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

     

  • shi012 Profile Picture
    20 on at

    Hello @Anonymous,

     

    If you are looking for a course to learn more about Plugins and JavaScript do check out this website. Dynamics Labs 

     

    Regards

    shi012

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard