Filter on key or value in JSON like column

Or3
ServiceNow Employee
ServiceNow Employee

Hi everyone,

I want to add a new "Tags" column to a table with key-value pairs (like a flattened JSON object).

My main requirement is the option to filter in list view on the keys and values of this field (for example: "Tags" key is "field1" and value is "name1").

I have checked the "JSON" and the "Name-value Pair" column types - but the filtering operators for these fields don't meet the requirements. 

Is there a column type that fits? Any idea how I can implement this if doesn't exist?

Thanks

 

2 REPLIES 2

Tom Sienkiewicz
Mega Sage

The only way to do that using the "regular" list filter I can think of would be to use the "CONTAINS" parameter - not very elegant. It could look something like your_json_fieldCONTAINS'field1':'name1'. Have not tested if this would work but since effectively this is a string value, it should.

I believe that to 100% match your requirements, you might have to create a dedicated ui page or portal page for displaying a list of records with a custom filter.

Mohith Devatte
Tera Sage
Tera Sage

Hello ,

I have created  a key value pair type field on the table but the only way is to use CONTAINS filter just like below which will give you the result partially.

In this screenshot you can see i did CONTAINS TEST key value in the Testing1 field and it gave the result.

find_real_file.png

Try this it might work for you

Please mark my answer correct if it helps you