Skip to main content
Solved

In my component, how do I pass on an added column after a Json Call?


Marcel-Jan
Star Blazer L2
Forum|alt.badge.img+1

I am building a component that carefully prepares input in an Alter format step to be used in a Json Call that creates a ServiceNow incident. One of those added columns is called load_id. I want to store the output of the Json Call in a database table _with_ the load_id. So that I can relate data in the table with output with other tables.

This is my Alter format step before the Json Call:

load_id is mapped as a parameter coming from the workflow that runs the component. That works. And when I run the component standalone and fill in load_id by hand, that also works.

So here is my data stream in the Json call:

Adding load_id probably won't work here, because after all it's not part of the JSON output from the ServiceNow call.

When I read the snowresponse data stream and send it to a Jdbc Writer I have no load_id. I've tried adding it as a shadow column, but the Jdbc Writer then complains that load_id is null (and I set the table column as not null).

 

So the currently I use this hacky way to join my Alter format data with a surrogate key to the snowresponse data stream.

 

Surely there must be a better way to pass existing columns on after a Json Call?

Best answer by AKislyakov

Hi @Marcel-Jan, you can access input columns of a Json Call using the in. prefix, in.load_id and in.load_datetime in your case.

There is an example of such approach in the Tutorials project in the 12.02 Json Call.plan

 

 

View original
Did this topic help you find an answer to your question?

Forum|alt.badge.img+2

Hi @Marcel-Jan, you can access input columns of a Json Call using the in. prefix, in.load_id and in.load_datetime in your case.

There is an example of such approach in the Tutorials project in the 12.02 Json Call.plan

 

 


Marcel-Jan
Star Blazer L2
Forum|alt.badge.img+1
  • Star Blazer L2
  • February 16, 2024

Hi @AKislyakov 

Yes, that works for me. This makes my component so much simpler. Really happy about that.

Thanks!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings