Concatenating Dynamic Variables in Record Filter Screen


(Lewis) #1

Hi,

I’ve got an Asset Listing and a CSV Data Source which I’m trying to use in such a way that the user can filter by date of birth.

I’ve got a simple HTML form setup with dropdowns to dateOfBirthYear, dateOfBirthMonth, and dateOfBirthDay. The format of each one matches the date_of_birth record in the Data Source Record Sets - i.e. 02 for Februrary, 01 of the 1st of the Month and so on.

In the Dynamic Inputs screen of the CSV Data Source, I’ve setup dobY, dobM, and dobD to match the incoming GET variables - dateOfBirthYear etc.

In the Record Filters screen of the CSV Data Source, I’m trying to concatenate the dobY, dobM, and dobD to form a date with the same format as the date_of_birth Data Source Record Set date_of_birth field:

%%dobY%%-%%dobM%%-%%dobD%%

It was a long shot, but I thought it might work, however it doesn’t produce any results.

Any ideas? I’ve tried changing the variables on the Dynamic Inputs screen - concatenating the GET variables there instead, but that doesn’t work either.

As I say - a long shot (the manual doesn’t say you can do this kind of thing at all, but it doesn’t say you can’t either).


#2

Use a date type input field. The value format is yyyy-mm-dd.
Otherwise use a hidden field and build it yourself from the displayed fields on the client.


(Lewis) #3

Hi @bkelly. Thanks for your reply.

I’ll take a look into these suggestions, but I’m not sure about their fit for our circumstances - we need to try and avoid client side scripting as much as possible, and support older browsers that perhaps don’t implement date inputs.


#4

OK this should work. In your Data mappings, create one variable with the source being a Set Value, and reference your get parameters there.

eg
%globals_get_dateOfBirthYear%-%globals_get_dateOfBirthMonth%-%globals_get_dateOfBirthDay%


(Lewis) #5

Hi @bkelly. That’s what I thought, so I tried it but it doesn’t work. I’ll give it another go incase I missed something as would be good to get this working.