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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to use Option Sets...
Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 309

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.

 

Goal

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

I have the same question (0)
  • Satish1024 Profile Picture
    279 on at

    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:

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/walkthrough-write-your-first-client-script

     

     

     

    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
    
    formContext.getAttribute("your_attrbute_logical_name_to_set").setValue(finalString);
    
    }

     

     

     

     

    Please mark it as answer if my code helps.

     

    Thanks
    Satish Reddy
    https://pascalcase.com

     

  • Hamish Sheild Profile Picture
    3,005 Most Valuable Professional on at
    Hi,

    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 https://docs.microsoft.com/en-us/power-automate/workflow-processes

    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.
  • Satish1024 Profile Picture
    279 on at

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

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

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard