cancel
Showing results for 
Search instead for 
Did you mean: 

REST Post JSON Payload AND Use Snap Variable

matt_bostrom
New Contributor II

i bumped into an issue here. how would i be able to pass in a variable for the “Service URL” parameter of the REST Post snap if prior to the REST Post I did a JSON Generate Snap. With JSON Generate you lose the documents prior to that snap (there is no pass through option). so by the time it gets to my REST POST snap the variables from the mapper preceding the JSON Generator are lost.

Since we are not able to update pipeline parameters in runtime (which would be perfect for this) it cant work. How else can we do global variables that can dynamically change at runtime?

image

1 REPLY 1

robin
Former Employee

@matt.bostrom, JSON Generator can use upstream document expression variables, and REST POST supports specifying a field within the input document as the request body. Combining those will get what you want:

image

I’ll make a note about adding pass-through support to JSON Generator.