# Multi-Select Highlight Rule

**URL:** <https://forum.kx.com/t/multi-select-highlight-rule/12342>\
**Category:** Community Support\
**Tags:** add-ons\
**Created:** [January 10, 2022, 1:32pm UTC](https://forum.kx.com/t/multi-select-highlight-rule/12342 "2022-01-10T13:32:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leades2](https://avatars.discourse-cdn.com/v4/letter/l/a87d85/32.png) [@leades2](https://forum.kx.com/u/leades2)\
**Post date:** [January 10, 2022, 1:32pm UTC](https://forum.kx.com/t/multi-select-highlight-rule/12342/1 "2022-01-10T13:32:00Z")

</div>

Hello,

Below are the steps to create a highlight rule from a multiselect dropdown list.

1. Have the viewstate for the dropdown list be of type list

1. Create a virtual datasource with the following code to change the selected viewstate to a different format

function (list, callback) { var toReturn = { columns: [“Syntax”, “Search”], meta: { Syntax: 11, Search: 11 }, rows: [{ Syntax: “Syntax”, Search: list.join(" OR ") }] } callback(toReturn); }

?3. In this virtual datasource, set the list as the “selected” viewstate, and the value of the output to a new viewstate of type symbol

?4. Now create your highlight rule on the data grid with condition operator “search” and using the “correctSelected” as condition value

?Now you should be able to highlight multi rows in a data grid from a drop down list

Feel free to suggest improvements below.

Many Thanks

Luke

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![LeahS1](https://avatars.discourse-cdn.com/v4/letter/l/3da27b/32.png) [@LeahS1](https://forum.kx.com/u/LeahS1)\
**Post date:** [January 10, 2022, 5:49pm UTC](https://forum.kx.com/t/multi-select-highlight-rule/12342/2 "2022-01-10T17:49:00Z")

</div>

Super @leades&nbsp;&nbsp;

Confirming that this is the accepted solution when&nbsp;creating a highlight rule from a multiselect dropdown list.

Happy Coding ,&nbsp;

Leah&nbsp;
