Simplify Workflows with Custom Code

Simplify Workflows with Custom Code!

June 24, 20242 min read

Custom code is an exciting new feature in Gold Star Pro's workflow builder. This addition is perfect for advanced users looking to integrate specific functionalities into their workflows without waiting for future updates. Let's walk through how to leverage this feature.

Custom Code Overview

Custom code allows you to execute JavaScript within your workflow. This feature is ideal for tasks that are unique to your industry or too specific to be included in the standard workflow options. Here's a step-by-step guide on how to use custom code:

Step-by-Step Instructions

1. Accessing Custom Code

  • Navigate to Workflow Builder: Open your workflow where you want to add custom code.

  • Select Custom Code: Choose the custom code action to add it to your workflow.

    Select Custom Code

2. Writing JavaScript Code

  • Start with JavaScript: Currently, the custom code feature supports JavaScript. In the future, more programming languages may be added.

    Start with JavaScript

  • Include Necessary Properties: Specify which data from the workflow you want to include in your code. For example, you can create variables for contact information:

    Include Necessary Properties

3. Coding Example

  • Define Input Data: Access the included properties through a variable called inputData.

  • Sample Code:

    javascriptlet result = inputData.number1 + inputData.number2;return { result: result };
  • This code concatenates two phone numbers as strings.

4. Testing Your Code

  • Run Test: Test your code to ensure it functions correctly. Note that custom values won't be passed during testing.

  • Check Output: Ensure your output is a JavaScript object or an array of objects.

    Check Output

5. Using the Output

  • Output in Workflow: The output from your custom code can be utilized in subsequent steps of your workflow. This allows for dynamic and customized workflow processes.

Key Points to Remember

  • For Advanced Users: This feature is designed for users with programming knowledge who need advanced customization.

  • JavaScript Only: Currently, only JavaScript is supported.

  • Testing Required: Always test your code to ensure it runs correctly before using it in live workflows.

  • Variable Naming: Clearly name your variables and properties to avoid confusion and ensure data flows correctly.

Conclusion

Custom code in Gold Star Pro opens up new possibilities for workflow customization, allowing advanced users to tailor workflows to their specific needs. While it might not be necessary for every user, it's a powerful tool for those who need it. Kudos to the team for this fantastic feature!

Back to Blog