Keyword construct to refer to a value of a CSV datas ource record set


(James Azurin) #1

Matrix Version: 5.3.4.2

I have a CSV Data Source Record Set as follows:

CSV Data Source - 1598728

  • Data Source Record Set 1598728:0
  • Data Source Record Set 1598728:1
  • Data Source Record Set 1598728:2

I’d like to list the %ds__surname% value for each record in an Asset Listing Page, something like…

%asset_assetid^as_asset:ds__surname%

What is the keyword replacement construct I need?

Cheers
James


(Hugh McMaster) #2

Hi James,

In the asset listing Default Type Format (or custom type format), you just need to use %ds__surname% as the keyword.

Edit: The Details screen of your CSV Data Source will list the data keywords you can use in your Default Type Format.


(James Azurin) #3

Sorry, I should have explained better.

I have a Search asset with a dynamic get variable called ids.

I want the URL: search_asset_webpath?ids=<id of data source record set, id of data source record set, etc> to return the values of %ds_surname% given the supplied asset ID’s in the query string.

I hope this clarifies.


(Hugh McMaster) #4

You can’t use shadow record assets with a Search asset.

I’d recommend using a dynamic input (your GET variable) and passing that to the CSV data source’s record filter. Set up your asset listing to use the data source record set and then print your values using the %ds__surname% keyword.

You will need to pass the ids variable to the asset listing.


(Nick Papadatos) #5

I’m actually trying to do something similar where I have an asseet listing with Replacement Root node for the listing (must be a child of the static root node) > source Get variable “filter”

CSV data source dynamic input parameter filter > source get variable name filter

so when I try mysite.com.au/asset-listing?filter=12345:0,12345:1,12345:2 nothing gets filtered. Have I missed something?

I’m using the normal keywords %ds__title% etc in the default format.

cheers
N


(James Azurin) #6

Hi Hugh

No luck for me. Rather than a Search asset, I’ve now got an Asset Listing Page using a dynamic input GET variable on the CSV data source as suggested. It’s as if the asset_listing_page_webpath?ids=[values of GET variable] is ignoring the ?ids parameter. I wonder if this is still because the asset listing can’t see the CSV data source shadow assets.


(Hugh McMaster) #7

You normally configure a data source record set to return information you expect to find in the data. So, you would filter the record set by passing the name of a suburb to the the asset listing via a GET variable. This then filters the data source record set to return data records matching that suburb.

In both cases, passing shadow asset IDs will not work (or, at least, I’ve never seen that done). This is the opposite of the intended usage.


(Hugh McMaster) #8

A few other things to remember:

  • Set your asset types to list as “Data Source Record Set”.
  • The static root node is the CVS data source.
  • Shadow records are not real assets, so you can’t work with them like you would other assets.

(James Azurin) #9

Thanks for your time and efforts Hugh. I’ll resort to uploading an additional Id field in the CSV data source to match the shadow assets - this should then work :slight_smile:Cheers