SnapApp Functions
on 08-19-2024 12:00 AM by SnapApp by BlueVector AI
1004
SnapApp Functions extend SnapApp Expressions by enabling the implementation of custom Python functions. This integration allows for enhanced flexibility and customization within your SnapApp environment, leveraging Python’s capabilities to perform specific tasks or calculations tailored to the application’s needs.
Steps to Implement a SnapApp Function
- Navigate to Settings > Automation > SnapApp Function.
- Tap on
Add New
button in the list view header. - Provide a name of the function. For consistency, use all capital with underscores (
FUNCTION_NAME
). - Add description of the function.
- Add the parameters to Function Parameters field as a comma-separated list. For example,
param_1,param_2
.
- In the Function Body, type or paste python code. Code can also be generated from Generate Code button by giving prompt.
- Insert values in Input Arguments and tap on
Execute
button to test the function and get output in the Output field.
- Function Examples is optional. It is for example use of the function in the format [{“syntax”: ” ” ,”returns”: ” “}]
- Function syntax gets populated with the provided function parameters
- Select the Return type of the function from the dropdown.
- Select Yes from the dropdown of the Active field.
The entire SnapApp function setup should look like the following screenshot. This screenshot defines a python function that divides two numbers:
The function name can now be used anywhere functions are accepted.
This can also be used as Workflow and Integration action.
Thank you for following these steps to configure your SnapApp components effectively If you have any questions or need further assistance, please don’t hesitate to reach out to our support team. We’re here to help you make the most out of your SnapApp experience.
For support, email us at snapapp@bluevector.ai