CMDB Integration Studio Application Data Source Before Script

Olsztyniak
Tera Expert

I am looking for help understganding Before Script in CMDB Integration Studio Application Data Source.
Specifically looking for information how to see what is in the input variable passed to the script.

2 REPLIES 2

MuddanKT
Mega Contributor

Hi Olsztyniak, In CMDB Integration Studio (CIS), when you use a Script as part of a Data Source (usually inside a Data Ingestion Plan), the platform passes data into your script through a variable typically named:

input

1. How to View the Input Variable

Use gs.info() Logging

You can print the entire input object:  

 

gs.info("CIS Input: " + JSON.stringify(input));

 

This works because in CMDB Integration Studio, the input variable is usually an object containing:

  • payload

  • data source parameters

  • connection values

  • pagination tokens, etc.

After adding this line, run the Data Ingestion Plan and check:

System Logs → All → Messages

Search for: CIS Input:

 

 

2. Use gs.print() in a Scoped App Script

If running in a scoped app (cmdb_integration_studio):

 

 
"  /  gs.print("Input: " + JSON.stringify(input));  /  "
 
This appears in Background Script log output or System Logs.

3. Use the Script Debugger (best for interactive debugging)

  1. Go to Script Debugger

  2. Choose Scope: CMDB Integration Studio

  3. Run the Data Ingestion Plan

  4. Breakpoints in your script will pause and allow you to inspect variables (including input)

Summary

To see what’s inside the input variable passed to a CMDB Integration Studio script:

Method Best For
gs.info(JSON.stringify(input))Quick logging to system logs
Using Script DebuggerFull inspection + breakpoints
Return-value loggingSeeing transformed output

 

Let me know how the above three points has worked for you. Or  share us how you were able to fix this if this has already got the solution with your own research 

MuddanKT
Mega Contributor

In continuation here is a sample minimal script 

CIS Script with Input Inspection

"/

 
(function() { gs.info("=== CMDB Integration Studio Input ==="); gs.info(JSON.stringify(input)); // Return required structure return { status: "success", data: [] }; })();
 

/"