HTTP binding use system variables?

Hi,

With using the HTTP binding I would like to pull a report with the current date in a JSONPATH expression.

So something like:

JSONPATH:$.[?(@.date == $CurrentSystemDate)]

I know I can do this with a rule and using the HTTP client, but I prefer doing it with the HTTP binding, if possible.

Regards,
Bastiaan

Entering that in stateTransformation should do the trick.

Yes, thats the place for a transformation but what are the variables I can use there?

Ah. I misunderstood it then. I believe that is not possible. You could use javascript transformation if you don’t want to write a rule for it.

1 Like

Can a Javascript transformation be nested within a JSON transformation?

Not nested, but perhaps chained is the keyword. You can extract something with JSONPATH and pass the result to a JS transformation.

I can’t see that’s very helpful; it sounds more like you want to pass the whole JSON to a JS script (which can deal with JSON natively), check the date element against “today”, and pass the rest of the JSON data along?

EDIT - I suppose chaing might be useful, after all. Each channel can only handle a single data item - but you could have multile channels, each using the same date-checking JS, but chained to different JSONPATH to extract each item.

2 Likes

@rossko57 yes, that would make more sense. Thank, I can work with this.