Best way to filter Data Source Record Set by JSON output


(Emily) #1

Matrix Version: 5.2.4

I have read a similar post from 2012 regarding how you cannot filter a Search Page by the Data Source Record Set ‘Data Attributes’.

I am wondering if there are better ways to do this now, in the 4 years since that post.

At the moment I have a REST Resource which a JSON Data Source reads from.
I then have an Asset Listing which can display the Data Attributes of the DSRS. (I actually have two of these, one to display a list of all the DSRC, and then it has links to another asset listing which displays the data attributes).

I need a way to be able to make it essentially a Search Page - with a number of optional filters that the end user can apply if they wish.

I don’t have much experience using the Data Source assets, and best ways to list them.

What would be the best method(s) for what I need to do?

Thanks,
Emily.


(Bart Banda) #2

2 ways I see. You could potentially filter it using server side JS in the REST JS asset based on URL GET parameters passed to it (using %globals_get_var% keyword), or try the Record Filter screen https://matrix.squiz.net/manuals/data/chapters/db-data-source#record-filters ?


(Emily) #3

Thanks Bart.

I have ended up using the Record Filter of the JSON Data Source. I had gotten the impression (incorrectly!) that the filter was for filtering the data on the way INTO the JSON DS asset, rather than being able to apply variables & filters on the data AFTER it has been imported. :slight_smile: