Date Formatted CSV Data Source Record Set


(Lewis) #1

We’ve got a list of locations together with dates for each one. Via an asset listing, I can access the name of the location for each CSV data source record set but when I try to access the date, nothing is printed.

For example:

<script runat="server">
 var thisLocation = '%ds__location%';
 var thisDate = '%ds__date%';

 print( thisLocation+" is being cleaned on "+thisDate);
</script>

The location is printed in the sentence but not the date - it’s blank!

I’ve tried removing all the SSJS and just using %ds__date% too but still nothing comes out. I’ve checked the asset listing and it is listing the write assets - unpublished CSV data source record sets with a specified root node but still nothing.

The only difference I can see if that the location is a simple string but the date is formatted like … well, a date - 26/05/2021 for example.

Any ideas?


(Bart Banda) #2

What do you get if you simply print %ds__date% outside of the SSJS by itself in the listing format? Does it print anything?

What does the details screen look like for your data source record sets?


(Lewis) #3

Morning @Bart. Nothing (see attached). Weird, huh?

image


(Bart Banda) #4

That’s weird.
What version of Matrix are you using?

Any chance you could share the CSV file here so we can see if we can replicate it somehow on our end?


(Lewis) #5

Version 5.5.3.3 @Bart. I can’t upload the doc as the Forum won’t allow it in CSV format. Here’s an excerpt from the equivalent CSV (Comma Delimited) formatted doc anyway:

Date Road Town
24/06/2021 Some Road Somewhere Town
01/07/2021 Another Road Another Town

(Lewis) #6

The CSV file is accepted into Squiz Matrix and the records broken down. The data (24/06/2021, for example) isn’t change during that process and it shows in the exact same format in the data record set (see above) but unfortunately, nothing shows in the asset listing, with or without SSJS @Bart


(Bart Banda) #7

That’s really weird, I tried the same exact data and can’t replicate in 5.5.6.11.

I wonder if it has something to do with the PHP version you are on, are you using PHP 5 or PHP 7?


(Lewis) #8

Hi @Bart. Just fetching the version from the development team.


(Lewis) #9

Hi @Bart. We’re running version 7.3


(Bart Banda) #10

Then I’m out of ideas :frowning:
Might need to send a ticket in to Squiz support (if you are a customer) so that they can have a closer look and try and figure out what’s wrong.


(Lewis) #11

Ok, cheers @Bart. Will do.