Showing results for 
Search instead for 
Did you mean: 
Advocate IV
Advocate IV

How to use Option Sets columns inside a Calculated text field?

Since I cannot find anything online, I'm hoping to tap into expert knowledge here...


I have a single entity with 3 options set columns in CDS, namely, Grade level, Genre, Format with their own internal IDs.



My goal is to have a text field with the concatenated corresponding label values such as (3 Writing Online) and not (100,003, 100,008, 100,010).  


In the calculated form, the intellisense doesn't even show the options sets 😞


Any tips or example would be appreciated...

Kudo Kingpin
Kudo Kingpin

Easy with JavaScript. I wrote a function for you. You have to change the attribute names below to reflect your attributes.

You can call this function on the on-change event of the three option set attributes (adding the event handler). If you don't know how to upload JS & add an event handler, steps are described here:




function ConcatLabels(executionContext) {
    var formContext = executionContext.getFormContext();    

    var gradeLabel= formContext.getAttribute("your_attribute_logical_name").getText();
    var genreLabel= formContext.getAttribute("your_attribute_logical_name").getText();
    var formatLabel= formContext.getAttribute("your_attribute_logical_name").getText();

var finalString = gradeLabel + genreLabel + formatLabel; // you can format your string here

//set the finalString to your attribute







Please mark it as answer if my code helps.


Satish Reddy


Super User
Super User


If you want a no-code approach then you can use CDS classic workflow. Trigger the workflow on change of your option set fields and use it to populate a text field that are the option set fields concatenated.

Details on classic CDS workflows are here

Let me know if you need anymore help with this option.

Note, for the JavaScript solution provided previously. You might find that the onload trigger of the code will probably not work for you. You will need to trigger it on the onchange event of your option set fields.

@HSheild  I second that. The handler has to be added on on-change events, not on-load. I am editing my post.

Helpful resources

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (3,246)