In this article:
- What is a Lambda function?
- Related definitions
- How to create a Lambda function in Gridly?
- How to run a Lambda function in Gridly?
- How to edit a Lambda function in Gridly?
- How to delete a Lambda function in Gridly?
What is a Lambda function?
Lambda function is a part of Trigger. It allows you to upload and execute a source code with a condition of Trigger.
Watching columns are set by the user so that if there is any change in these columns, the Trigger event (or events) that has been set is triggered. Watching columns can be a column or many columns.
In Gridly, Postback function allows a Trigger to send all the returned values back to Gridly from a Lambda function or a webhook.
To use the Postback function, user need to:
- Add output fields (returned values) of a webhook or a Lambda function.
- Select specific columns in Watching columns (cannot select All columns or Empty)
- Map output fields with existing columns based on the demand.
How to create a Lambda function in Gridly?
1. Open a Grid and click on the Trigger icon in the right sidebar. Then, the Trigger section is displayed. This section includes all available triggers associated with the current View.
2. Click on Add Trigger to create a new Trigger.
3. A new Trigger will be created. Enter a Trigger name and press Enter.
4. Select a condition for the new Trigger.
5. Select Invoke Lambda function option.
6. After selecting Invoke Lambda function, click on Add function to create a new Lambda function.
7. In the Add new function pop-up window, you need to upload the source code and enter metadata of the source code:
- Package: select and upload the source code from your local computer. Please note that the .zip file must contain all files and libraries of the source code without a root directory.
- Function title: the descriptor for the Lambda function.
- Runtime: the runtime environment of the Lambda function.
- Main file name: the file name of the file containing the main function.
- Handler name: the name of the main function.
- Output fields: returned values of the main function.
8. Click on the Add button to finish.
How to run a Lambda function in Gridly?
1. In Invoke Lambda function section, choose a Lambda function you want to execute.
2. Enter the Payload and select watching columns. Watching columns allows you to select columns for which you want to listen for changes.
Please note that All columns is the default option of Watching columns and you must select specific columns to use the Postback function.
3. Map the results and columns in the Postbacks section, or you can skip this step. For now, the Postback function is made only available to Record created and Record updated conditions.
4. Click on the Create button to save the new Trigger.
After the new Trigger is created, if you do some actions that match the condition of the new Trigger, the Lambda function will be triggered.
How to edit a Lambda function in Gridly?
1. To edit a Lambda function, click the Edit button when you are in the Invoke Lambda function section.
2. Click on the Update button to finish.
How to delete a Lambda function in Gridly?
To delete a Lambda function, click on the Delete button when you are in the Invoke Lambda function section.