Create Scripts for CCDS
You can create scripts to retrieve data from a source system. Scripts reference their unique names created in the Parameters Maintenance Panel.
Prerequisites
Prerequisites
- New to CCDS? See Concept: CCDS
- Required Permissions:Integration DeveloperinAdministration > Permission Set
- CCDS Developers must be experienced JavaScript programmers
Navigation
From the nav menu, go to Steps
- Select theScriptstab for your CCDS.
- Enter semicolon-separated URIs that your scripts connect to in theSource URIsfield. This field identifies the source system connected to your CCDS.
- Click the edit icon for theSampleCCDSJavaScriptfrom theIncluded Scriptspane or double click the row containingSampleCCDSJavaScript. TheSampleCCDSJavaScriptcode has templates for creating ahttps://request, sending a request, receiving a response and validating the response. Keyboard shortcuts:on Windows to format your scripts andCTRL + Shift + BCtrl+Htofind and replace.
- SelectSavein theActionspane.
Best Practice:
Make small changes at a time and run scripts often to find syntax errors more easily. Use Logs
in the Actions
pane to identify errors. Due to the sparse nature of error messages in the log file, it can be difficult to identify a problem if you've made many changes.Script Functions
Use the following functions in your script to test your connection, create or update the data source's schema, import rows from the source system to
Adaptive Planning
staging and preview data in the source system. See Adaptive Planning
functions. - testConnection() - Test the connection to the source.
- importStructure() - Import the data structure.
- importData() - Get data through https:// or a static source.
- previewData() - Preview the output data from the source system.