Skill level: Expert
Time required: 6 minutes
This article explains how to appropriately mention input values in JavaScript code using the NodeJS app in Quickwork.
Prerequisites
- A Quickwork account and and familiarity with the platform's GUI.
What is NodeJS app in Quickwork
NodeJS app in Quickwork allows you to execute JavaScript code snippets to process data for responsive workflows in Quickwork. These code snippets can be used for tasks like data mining, form validation, data interpretation, and search operations.
Quickwork’s NodeJS app provides an interface to execute JavaScript code tailored to specific business requirements. You can pass input values into your code using the following methods:
- Using the context object
- Passing data pills directly as values
Methods to provide input values
Specifying a value using the context object
The Context object maps keys in your JavaScript code to specific values, such as data pills from previous actions.
In this example, context.Email is a placeholder key. To define its value, you must configure the Context object fields in the NodeJs action.
Under the Context object section, provide:
- Key: The key used in the code, for example, Email
- Value: The corresponding data pill or static value
This approach ensures raw input values in your code are validated and mapped correctly.
Passing data pills directly as a value for the key
Alternatively, you can assign data pills directly as values in your code without using the context object.
In this case, the value is directly assigned using a data pill. However, you must ensure that, data pills of string format are enclosed in double quotes ("").
Prefixes of data pills in the Data Tree Output:
Prefix | Data type | Double-quotes required |
abc | String | Yes |
object | Object | No |
123 | Integer | No |
array | Array | No |
Comments
0 comments
Please sign in to leave a comment.