Cosmocloud Build Documentation
DocumentationTutorials
  • Welcome to Cosmocloud
  • Getting Started
    • 1. Organisations
    • 2. Projects
    • 3. Connect your Database
    • 4. Create Database Models
    • 5. Create APIs
    • 6. Testing Free Tier APIs
  • Free Tier
    • Connecting with MongoDB Data APIs
  • Templates
    • CRUD APIs
    • Entity Search APIs
    • Fetch / Upload Media APIs
  • Examples - How To?
    • Making an external API call
    • Reusable Flows - SubFlows
    • Creating Custom Error Responses
    • Flow Builder - Building Conditional Logics
    • Flow Builder - Utilising Loops
    • Creating Dynamic Queries
    • Accessing Auth Tokens in APIs
    • How to upload/download media in Object Storage
  • Resources
    • APIs
      • Checking Logs
    • SubFlows
    • Models
      • Building Models
    • Environments
      • Environment Tier Types
    • Secrets
      • Custom Secrets
    • Databases
    • Releases
    • Vector Search
      • Create a Vector Search Index
      • Edit a Vector Search Index
      • Delete a Vector Search Index
    • Document Search
      • Full Text Search
        • Concepts
          • Indexing in full-text search
          • Data processing using Analyzers
        • Create a Search Index
        • Creating a Custom Analyzer
        • Full Text Search FAQ
      • Vector Search
    • Object Storage
  • Flow Builder
    • Node Types
      • Trigger Nodes
        • HTTP Response
      • Conditional Nodes
        • If Else
        • If Else V2
        • Switch Case
      • Crypto Nodes
        • PBKDF2 Hmac Hash
      • Debug Node
      • Database Nodes
        • Delete One
        • Delete Many
        • Fetch By ID
        • Find One
        • Find Many
        • Insert One
        • Insert Many
        • List Records
        • Run Aggregation Pipeline
        • Update One
        • Update by ID
        • Update Many
      • External Nodes
        • Fire Events (SQS)
        • API Call
        • Delete storage objects
        • Execute SubFlow
        • Get Presigned URL
        • Post Presigned URL
        • Send EMAIL (SES)
        • Send SMS (SNS)
      • Loop Nodes
        • For loop
        • While loop
      • Variable Nodes
        • Arrays
          • Append array
          • Contains
          • Check array empty
          • Extend array
          • Get Array Item
          • Length of array
          • Reverse array
          • Sort array
        • Date and Time
          • Set current datetime
        • Strings
          • Append String
          • Concat Strings
          • Convert to String
          • Length of String
          • Slice String
          • Split String
          • String Operations
          • To Lower
          • To Upper
          • Trim String
        • Mathematical
          • Add Variable
          • Complex Math Expr
          • Decrement Variable
          • Divide Variable
          • Increment Variable
          • Multiply Variable
          • Subtract Variable
        • JSON
          • Build JSON Object
          • Merge JSON Objects
          • Object to String
          • Update JSON Object
        • Special
          • Build Map
          • Set Variable
          • Exists Check
    • Node name
    • CQL - Cosmocloud Query Language
      • Building Expressions
        • $abs
        • $add
        • $addDate
        • $arrayElemAt
        • $avg
        • $buildDateTime
        • $buildMap
        • $ceil
        • $cond
        • $divide
        • $floor
        • $getDay
        • $getHour
        • $getMinute
        • $getMonth
        • $getSecond
        • $getYear
        • $ifNull
        • $max
        • $min
        • $mod
        • $multiply
        • $pow
        • $subtract
        • $sqrt
      • Building Conditions
        • Compound Operators
          • $and
          • $or
        • Conditional Operators
          • $eq
          • $gt
          • $gte
          • $lt
          • $lte
          • $neq
      • Magical Autocomplete
  • Advanced Guide
    • Configuring Authentication
      • SSO Providers
        • AWS Cognito
      • Authentication Concepts
    • MongoDB Query Language
      • Limitations
    • Performance Considerations
      • Instant Deployments
  • User Management
  • Billing and Payments
    • Billing Portal
  • Help & Support
  • References
    • Change log
    • Available Cloud & Regions
Powered by GitBook
On this page
  • Accessing values using `$.`
  • Accessing node data using `$.`
  • Example
  • Accessing variables using `$.`
  • Accessing token data using `$.`
  • Example
  • Accessing secrets using `$.`
  1. Flow Builder
  2. CQL - Cosmocloud Query Language

Magical Autocomplete

Magical Autocomplete is a feature in Cosmocloud which is introduced to access dynamic values within the API Flow.

User can access these values using $. abbreviation. This is super helpful when you want to access data from one node into another, for example reusing some value returned by parent in child.

When user type $. in any input field in the node's properties window, it gives the user a list of autocomplete values which user can assess in that node level.

Accessing values using `$.`

These are 4 ways to access data using Magical Autocomplete -

  • Node data: $.<node_name>.<key>

  • Variables: $.variable.<variable_name>

  • Token data: $.tokenData.<key>

  • Custom secrets data: $.secrets.<secret_name>.<key_name>

Accessing node data using `$.`

Nodes in cosmocloud are basic building blocks for your API's. Each node can be considered as a single operation ( e.g. create , update , delete etc. ) that user needs to perform in flow.

Some of these nodes return values which can later be used in the flow.

For e.g. API call node is used to call an external API which in turn returns us statusCode and body

Now to access the values returned by this node we can use following syntax

$.<node name>.<return value>

Example

Let us assume you make an external API call using API call node and want to access the response in the flow.

Now we can access the value of this node as :

  • $.node_7.body

  • $.node_7.statusCode

Accessing variables using `$.`

Some of the nodes in cosmocloud is used to initialise variables is runtime. These nodes create a new variables which can later be accessed in the flow. eg. Set Variable , Build JSON etc.

You can access these variables using $.variables.<variables name>

For the variable declared above using Set Variable node you can access it as $.variables.newVariable

Accessing token data using `$.`

Accessing token data using $ abbreviations is very easy. you can either access raw token to be used in external API calls or you can access decoded token for values.

$.tokenData helps you access decoded bearer token values or raw token to be used in external API's

  • Raw token : $.tokenData.rawToken

  • Decoded token : $.tokenData.<variable_name>

Example

Let us assume you are using a authentication service on cosmocloud and schema of your decoded token is in given format

{
  id : "012345678abcde"   // user id
  email : "example@gmail.com" //user email
  exp : 1234567643 // token expire at time
}

Now assume you want to access user email from bearer token . You can access is by $.tokenData.email and use it anywhere in your flow.

Now, what if you want to access bearer token as it is, so that you can use it for any external service ?

well you can access raw token as $.tokenData.rawToken

Accessing secrets using `$.`

Let us assume you have created a new custom secret named as AWS_SECRETS which store values for AWS credentials such as :

  • DEFAULT_REGION

  • QUEUE_NAME

Now what if you want to access these values in flow? well you can access them using following syntax $.secrets.<SECRET_NAME>.<KEY_TO_ACCESS>

for above case you can access these values as :

  • $.secrets.AWS_SECRETS.DEFAULT_REGION

  • $.secrets.AWS_SECRETS.QUEUE_NAME

Previous$neqNextAdvanced Guide

Last updated 1 year ago

accessible values using $.tokenData