Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
SAdlam
Contributor
Contributor

Context date parsing

Hi,

I'm fairly new to TOS, and have hit an issue with using a date context variable in a trestclient parameter.

I've got the context set to date

0693p00000BCpaoAAD.png

and have chosen a date from the date picker.

then within the trestclient parameter i've got the following to get the unix timestamp time.

0693p00000BCpbSAAT.png

I'm getting this error though when I run the job.

0693p00000BCpv3AAD.png

its almost as if the context variables are not being passed to the trestclient properly.

any pointers please? i've spent quite alot of time trying to get this working.

it works fine when i put in the figure directly!

Thanks 🙂

Steve

Labels (2)
12 Replies
Prakhar1
Creator III
Creator III

It might be the format of the date value you are passing in the context.

It should be like this yyyy-mm-dd hh:mm:ss (for ex - 2021-01-17 18:46:14 )

If you check the value filed of the context you can see "..." to select the value.

Use that option to provide the specific value.

And if you want only the date in dd-mm-yyyy format, then you need to change it using "TalendDate.formatDate(pattern, date)".

Or better try to pass date value as string in your rest api call.

SAdlam
Contributor
Contributor
Author

Thanks. i've been using the date picker, so the format is predefined and looks a what you say.

 

I think i must be doing something wrong across the board as my dbconneciton doens't work either. (get the same null value being parsed for a db connection.

 

uugh. fairly new to all this!

 

 

SAdlam
Contributor
Contributor
Author

Hi so a quick update.

 

I've set the db conneciotn up in the meta and this works fine. from the meta I setup a context, which is now passing null values. even thought the meta based on the context tests ok...

 

what am I doing wrong? It's just not making sense to me!

 

Screen shots below.

 

Error

Meta setup.

 

Component setup.

 

 

Prakhar1
Creator III
Creator III

The screeshot is not attached .

Could you add it again?

and in which format you are passing value in metadata and how you are passing in the dbConnection.

SAdlam
Contributor
Contributor
Author

sure sorry not sure how they got missed.

 

Please see attached

 

Context0693p00000BDeq4AAD.pngMeta

 0693p00000BDfTVAA1.pngComponent0693p00000BDerMAAT.png 

Error0693p00000BDerqAAD.png

SAdlam
Contributor
Contributor
Author

sorry forgot to hit reply. I've uploaded the additional screenshots...

Prakhar1
Creator III
Creator III

Might be some jar issues.. can you select the jdbc provider option in tDBOutput and make it as microsoft and then try

SAdlam
Contributor
Contributor
Author

Hi So I'm missing the JDBC Microsoft jar which I'm in the process of installing, but when I enter the values in as text the component works! odd

 

SAdlam
Contributor
Contributor
Author

nope didn't work still the same issue. the contexts are passing as "null" rather than the data entered.