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);

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?


(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 @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

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.

(Lewis) #12

Hi @Bart. Did Squiz Support ever come back on this one? I’m giving it a second run and still having the same issues - Squiz CSV Data Source doesn’t like dates. Could it be that, when a %ds__ starts with a number, it screws up Squiz in the backend?

(Jsisk) #13

Hi Lewis,
It might not be clear, but I think the suggestion from Bart was for you to lodge a Service Request with Squiz for this issue.
Then our team can investigate it further for you.


(Nick Papadatos) #14

Hey Lewis - long shot here but when you view a record do you get any unrecognised characters?
as shown here

(Lewis) #15

Hi @NickyP. No, there isn’t anything like that - just vanilla characters.

Incidentally, I’ve created a Data Record which uses a Metadata Schema to hold a user’s email address recently and originally called the metadata field email but had to change it to email_address as Squiz wouldn’t print anything otherwise.

When I revisit this, I’ll try calling the date field something like cleaning_date for example. See if that works. Not sure if I did before though … ?