11-05-2021 09:06 AM
Using jsonpath as the expression in a mapper snap the following works:
jsonPath($, “$entity.items[?(@.AssignmentNumber==‘E3163300-2’)].links[*]”).find(x=>x.name == ‘assignedPayrolls’).href
I want to pass in the assignment number from a parameter but this doesn’t seem to work:
jsonPath($, “$entity.items[?(@.AssignmentNumber=='_AssignmentNumber)].links[*]”).find(x=>x.name == ‘assignedPayrolls’).href
This is with parameter _AssignmentNumber set to the value that works which is ‘E3163300-2’
How can I get jsonpath to work with parameters or variables?
Solved! Go to Solution.
11-05-2021 09:23 AM
Hi @swright,
You need to concatenate the jsonPath with the pipeline parameter.
jsonPath($, "$entity.items[?(value.AssignmentNumber=='" + _AssignmentNumber + "')].links[*]").find(x=>x.name == "assignedPayrolls").href
11-05-2021 09:23 AM
Hi @swright,
You need to concatenate the jsonPath with the pipeline parameter.
jsonPath($, "$entity.items[?(value.AssignmentNumber=='" + _AssignmentNumber + "')].links[*]").find(x=>x.name == "assignedPayrolls").href
11-05-2021 10:10 AM
Thank you! Your solution worked perfectly! I had tried something like that before and it failed. It was probably my syntax but your syntax worked on the first try!