Solved

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

  • 15 February 2024
  • 2 replies
  • 20 views

Userlevel 3
Badge +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?

icon

Best answer by AKislyakov 16 February 2024, 00:37

View original

2 replies

Userlevel 4
Badge +4

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

 

 

Userlevel 3
Badge +1

Hi @AKislyakov 

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

Thanks!

Reply