
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using context variable in tFixedFlowInput
Hello,
I have an issue where i want to write an API body request in tFixedFlowInput component. My job looks like below image
In tFixedFlowInput, i write the body request like this and it works fine.
{"name":"all","group":"all","level":"all","frequency":"yearly","start_date":"2021-10-01","end_date":"2021-10-31"};
However I would like to define the date as context variable since it might change from time to time. I tried to put it like this but it doesn't work
{"name":"all","group":"all","level":"all","frequency":"yearly","start":+context.start+,"end":+context.end+};
I also tried with double quotes, single quotes, still it won't fetch the data. Can anyone help how should i put the context variable there? Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the whole string (json) has to be treated as a string in Java
thus any required double-qutes by JSON - have to be skipped in Java
try something like this:
"{\"name\":\"all\",\"group\":\"all\",\"level\":\"all\",\"frequency\":\"yearly\",\"start\":"+ context.start + ",\"end\":" + context.end +"};"
Note: the double-quotes around the variables are not skipped by a backslash

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi could you send a capture of the working tfixedflowinput ?
I suppose you use personalise content:
it will read it as base64 and decode it that's why it's only reading it as a pure string and not permit you to use context variable
instead maybe you can use the first option : one row table and set it as a string in the schema and use escape char like this:
"{\"name\":\"all\",\"group\":\"all\",\"level\":\"all\",\"frequency\":\"yearly\",\"start_date\":\""+context.start+"\",\"end_date\":\""+context.end+"\"};"
send me love and kudos

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
we think the same thing a the same time 😉
you're right XJ_1630 you just have to add an escape doble quote before and after context var
