Utopia Knowledge Base Definitions
  • Welcome to Utopia University
  • 🔦Overview
    • How to Navigate the University
    • How is Utopia different
    • Features
    • Utopia Sync Website Links
  • 😁Contact Us
    • Open Chat Room
    • Contact Us
  • ⬇️Installation guide
    • Docker Compose Installation
      • Prerequisites
      • The Installation Configurator
        • Databases
        • S3 (Optional)
        • SMTP Details (Compulsory)
        • Adobe API Credentials (Optional)
        • Final steps to get your compose fle
      • Compose Installation
    • Kubernetes Installation
      • Prerequisites
      • The Installation Configurator
        • Databases
        • S3 (Optional)
        • SMTP Details (Compulsory)
        • Adobe API Credentials (Optional)
        • Ingress Naming (Compulsory)
        • Final steps to get helm chart
      • Using Helm to Install and Edit
      • Final Stage DNS setup
        • Setting up TLS cert
        • Third Party Service DNS Manager (like Cloudflare)
        • DNS Work-around while you get your cert ready
    • Cluster Craft
      • Basic Kubernetes install with microk8s
      • Basic Kubernetes install with microk8s and NFS storage
      • Updating Loadbalancer IP with Microk8s and Metallb
      • Installing Utopia in Azure
      • Testing SMTP server from a Kubernetes Cluster or a Container using telnet and openssl
      • Kubernetes Visibility
        • Kube CLI visibility with Lens or OpenLens
        • Prometheus and Grafana Monitoring
      • Syntax Cheat Sheet
        • Kubectl
        • Microk8s
        • Microceph
        • Mongodb Compass
          • _MONGOSH Terminal Commands
          • Query Commands
        • Shell Commands
  • 🖥️Product Guide
    • Integration Hub
      • Selecting your Organization
      • Menu Navigation
      • Data In
        • Collection Parameters
        • Document Lifespan Strategy
        • Source Connectors
          • Connector Modules
            • Empact Email Orders
            • File Transfer Protocol (FTP)
            • Generate Random Documents (Test)
            • HTTP REST Collection Source
            • Lotus 1-2-3 prn file
            • Microsoft Navision Collection
            • MySQL Query
            • Pick n Pay Supplier Orders
            • Post Office Protocol (POP3)
            • Secure File Transfer Protocol (SFTP) (SSH)
            • Internet Message Access Protocol (IMAP)
            • Shoprite Collection
            • SQL Server Query
            • StrategixNav Collection
            • Transaction Query
          • Web Hook Triggers
        • API Listeners
          • Document Capture
          • Document Query (External)
          • Document Query (Integrated)
          • Listener Security
      • Transform
        • Search Documents
        • The Designer Panel
        • The Designer view
        • Transform Stage Types
          • Filter
          • Lookup
          • Add Field
          • Projection
          • Unwind
          • JS / JSON
      • Data Out
        • Publisher Collection Parameters
        • Data Out Connector
          • API Collection Publisher
          • Do Nothing
          • File Transfer Protocol (FTP)
          • HTTP REST Collection Publisher
          • Message Transport Post
          • Microsoft Navision Publisher
          • PDF Document Emailer
          • Pick n Pay Invoices
          • Post Syspro QueryQuery
          • Post Syspro Transaction
          • Post Vector Orders
          • Secure File Transform Protocol (SFTP) (SSH)
          • Shoprite Invoice Publisher
          • SMTP Collection Publisher
          • SQL Server OPENJSON Publisher
          • SQL Server Query Publisher
          • StrategixNav Publisher
      • Validation
    • Organizations
    • Transaction Page
    • User Profile
    • Logging
    • Process Que Dashboard
    • Process Error Dashboard
    • New Functions
      • XML to Json using the Transform Designer
      • XML to Json using ChatGPT
      • Rest Connector JS Prescript
    • Release Notes
      • Microservices
        • 0.12.1622
        • 0.12.1630
  • ☕Use Cases
    • Follow Along Examples
      • Look-ups! no-code Transform Stage
        • Multi Field Look-ups! low-code Transform Stage
      • Rest Connector JS Prescript Example
        • Rest Connector JS PreScript Fault Finding Techniques
      • XML to Json using the Transform Designer
      • XML to Json using ChatGPT
    • Solution Discussions
      • Moditar: Increasing Integration Adoption using UtopiaSync
      • UtopiaSync the scalable no-code Backend?
      • UtopiaSync Security - How does it work?
      • UtopiaSync Custom Configuration
      • UtopiaSync Maintenance
  • 😁Case Studies
    • How Moditar drove efficiency for Meridian Wine Merchants using Utopia iPaaS
    • The journey to Spier Wine Farm's perfect eCommerce Integration
    • Integration journey to 100% automated with La Concorde Bakery
Powered by GitBook
On this page
  1. Product Guide
  2. New Functions

Rest Connector JS Prescript

PreviousXML to Json using ChatGPTNextRelease Notes

Last updated 1 year ago

Sometimes simply doing a REST call and saving a parameter is not enough to get you the results you are looking for. The data between calls need some manipulation... this is where our JS prescript function can come into play.

Run a JS script on available data, which may come from saved parameter fields or a pre-request, then save data as a parameter to be used in your next request call. This can be extremely useful when dealing with tricky paging rules or sorting functions etc.

Check out the update in the Definition (this is also available as a ):

"Sometimes you may need to apply a calculation or two on some parameters or even a pre-request in order to get the data you are looking for. In this case you can use our "PreRequestScript" node. This can be used in both PreRequests and Request function and will run prior to the actual request. Currently we only allow javascript notation in the Code node. Note: if you want to save a parameter for future calls, you need to add the node in the parameter section (Path is not required if it is not being referenced out the document). To reference it in you JS script simply use this.yourParameterName and to save it just return it at the end of the call with the correct yourParameterName."

If you would like to run through a test example the syntax is shown in the page, or take a look at the "".

Don't forget to Restart your microservices deployment to pull the updated image. The version is available at the microservices swagger end point. 0.12.1602

🖥️
Rest Connector
publisher
Rest Connector Definition
Follow Along Example
Let us know if you like it!