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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Change Option set label based on formtype using javascript in crm 365

(0) ShareShare
ReportReport
Posted on by 2,667

Hi All,

How can i show one option set value to different label name based on condition like based on form type.

Action option set field is there on entity Action has 1 option set value suppose A 

Then based on form type suppose If form is B then show this option value with some different label ex :Send Action & If form is C then show this option value with some different label Send Condition

Is there anypossibility ?

Thanks,

Jharana

I have the same question (0)
  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    Hi Jharana,

    Just wanted to confirm, Form Type refers to different form label?

    As per my understanding, consider On Account, I have multiple Forms Says Form A, Form B and Form C then based on selected Form we need to populated the option set.

    if yes then we can use below logic.

    1. Get Form Label using 

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/formcontext-ui-formselector

    2. Set Option Set Field 

    formContext.getAttribute(arg).setValue(value)

    Thanks,

    Pradeep.

  • Jharana Baliyar Singh Profile Picture
    2,667 on at

    Hi Pradeep,

    Thanks for the reponse.yes different forms like A,B.

    With only one option set value it should rename & show with different text & for form B the same option value should get rename to different text.

    Is it possible in CRM ? because if we are having 2 option set values then we can easily show hide these option values based on different form.

    Thanks,

    Jharana

  • Verified answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    Hi Jharana,

    I don't think it is possible. because to add custom logic in option set field we need to define the list of option.

    Suggestion:

    if you want to change the text then instead of option set field we can use the SingleLine of Text

    and we can keep field read only so that user will not be able to update anything.

    Thanks,

    Pradeep.

    Please mark this as VERIFIED if it helps.

  • Ran Zhang Profile Picture
    Microsoft Employee on at

    Hi Jharana,

    I didn't test but I think this could be possible.

    Can't we create a JS to determin current form type and then set the optionset value?

    Xrm.Page.ui.formSelector.getCurrentItem().getLabel();

    Xrm.Page.getattribute()setvalue(); like this.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 98 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 72

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans