user94538
user94538

Reputation: 177

vars is not evaluated in the body of http requester in Mule 4

How to pass the value of variable (Vars) in body section of http requester in Mule 4?

For example : I want to construct a string like below in the body of http requester

{"Script":"Select ID from Student where StudenName = 'tom'"}

The student name in where condition should be a variable. I tried below but the value of vars.name is not getting replaced during runtime .enter image description here

Upvotes: 0

Views: 133

Answers (1)

Clinton Murdoch
Clinton Murdoch

Reputation: 453

You've got it inside quotes. This should work

#[{"Script":"Select ID from Student where StudentName = '" ++ vars.name ++ "'"}]

Upvotes: 1

Related Questions