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

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
    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

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 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

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

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans