โ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!