Skip to main content

HSD’s Technical Consultant – Rohan Perera gives us a handy hint on how to get text values of multi-select options when using FetchXML reports.

Currently we are not able display the multi-select option set’s text values in FetchXML reports.

However by creating a new text field and populating this field using JavaScript or plugin will allow you to use the text value in FetchXML reports.

  1. Use of JavaScript to poulate new text field:
  • Multi-select option set name:             new_languages
  • New text field name:                            new_languagestext
  • Script:
//Sdk.OnlanguageChange
        this.OnlanguageChange = function (executionContext) {
            var formContext = executionContext.getFormContext();
            var languagesCrl = formContext.getAttribute("new_languages");

            if (languagesCrl != null) {
formContext.getAttribute("new_languagestext").setValue("'" + languagesCrl.getText() + "'" );

            }
        }

Run this function in On Change event of the new_languages field.

2. Following URL describes how to get text values of multi-select option set.

How to Get Formatted values in c# code from Multi select OptionSet


If you or your organisation needs advice or assistance on ensuring your systems are meeting your needs, make sure you visit www.hsd.com.au for more information on the services we provide.

Be sure to keep up to date with all of HSD‘s news and content here and on our LinkedIn.