For AI agents: an index of this documentation is at https://developer.rippling.com/llms.txt. Public pages have a Markdown version at the same URL with .md added.

Skip to main content
guide

Invoke functions

Use with AI:Rippling AI ChatGPT Claude Cursor

Overview​

This guide dives into the methods of invoking functions in Rippling. You can invoke a function through:

  • Custom object actions
  • Custom app components
  • Automations
  • Pipelines

Custom object actions in record or detail view​

Custom object actions render as customer-defined buttons in key places throughout the Custom App UI. Functions and actions work in tandem to allow more power and flexibility in your custom app.

Actions Button

We must define an action to run our function with the following steps:

  1. Select Data > Catalog.

  2. Select a custom object.

  3. Select the Actions tab. Actions Tab

  4. Add a new action. The Rippling Function dropdown will show all the functions on which you have View access or greater.

Visibility Preference determines where the function can be called.

  • List View - The function can be called from a list and receives a list of record Ids.
  • Detail View - The function can be called from a single record and receives one record Id.
  • Both - The function can be called from either.

Add Action 5. Click Save.

Your action will now appear under the Actions drop-down button on tables and record detail pages for custom objects.

Custom app components​

Some of the components in custom apps have click events that can be leveraged to make function calls. See Page components for more information. You must first create an action, then call that action from your component's click event.

Create an action​

  1. Select Actions from within your custom app.
  2. Add a new Rippling Function action.
  3. Toggle the Trigger on Load if you want to trigger your function as soon as the page loads instead of waiting for a click event.
  4. Select the Function you want to call.
  5. If you want to provide a Payload to your function, input the key value pairs you would like to pass in.

You can also dynamically reference component states and global variables via JavaScript expressions by clicking ƒx. For example, if you want to disable an option based on the input of the previous component, you can input a JavaScript expression to read from the previous component.

  1. Add an Event handler, which will execute in response to a specific event.

There are two types of Events available:

  • On Trigger - Executes when the function is triggered.
  • On Response - Executes when the function response is returned.

Select a Handler, which determines how the UI responds to your event.

  • Control component - Controls another component on the canvas, like refreshing a table or report.
  • Control action - Triggers another action on the page, which allows you to call multiple functions sequentially.
  • Notification - Displays a custom notification on the page.

You can add multiple Event handlers, creating a complete UI experience. For example, you could refresh a table and display a success message when your function response is returned.

  1. Your action will automatically be saved when you navigate away from the Actions UI.

When adding a UI component, you will see an option to add an Event handler. This functionality is identical to adding an event handler on an action, as discussed in the section above.

To link the UI component to the action you previously created, select Control action from the Handler dropdown and select your action.

When saved, clicking the UI component will perform the action that calls your function.

Automations​

You can now use automations to trigger your functions, allowing you to automate function calls and call multiple functions sequentially.

  1. Select Tools > Automation Studio.

  2. Select the automations you want to call the function from and open for editing or create a new automation and trigger.

  3. Drag the Run Function step from the Rippling Actions menu.

  4. Select the Function you want the automation to run.

  5. Enter the Parameters you want to pass to the function. For example, if you want to update a custom object record, you need to pass in the Record ID, and if you want to update an employee, you need to pass in the Employee ID.

    • Basic - Type in values manually, or select from existing automation variables in the UI.
    • Advanced - Write a JSON object using the code editor. You can select from existing automation variables here as well. The code editor has built-in code completion and will let you know if your input is in a valid format.
  6. Optional: Define an Output Schema to use the results from the API response in a later step of the automation.

  7. Save the automation. The function call will now be included as a step when the automation is triggered.

Output schema​

You can use the code editor to write a JSON object, or click Generate schema for API response, which will run a test call of your function and return the output schema.

Format​

{
"type": "object",
"properties": {
"field_example_1" : {
"type": "string",
"format": "date"
},
"field_example_2" : {
"type": "number"
}
}
}

Example​

{
"type": "object",
"properties": {
"available_seats__c": {
"type": "number"
}
}
}

You can also insert automation variables to set your automation variables using a function response. To do this, follow the steps below.

  1. Return the values from your function in the function response body.

Function output variables

  1. Write a JSON object in the output schema matching a property to each of the variables returned by your function.

Automation output schema

  1. Save the automation

Now, when the automation is executed, the function variables will be set when the Run Function step is executed, making the variables available in future automation steps. You can see them in the automation's execution history by looking at the output under the execution details.

Automation output

You can also see the structure of your output schema under the inputs tab.

Automation inputs

  1. Use the function variables by selecting an automation step and clicking insert automation variables. Here, you can select the variables from your function.

Function output variables

Pipelines​

You can use functions to power custom pipelines, allowing you to ingest data from third-party APIs that require custom processing logic. Function-based streams are ideal when you need to handle complex API response structures, reformat values, or perform calculations before storing the data in Rippling.

Note: To create a function-based stream, you must have access to the Developer app.

Add a function-based stream​

  1. From the main sidebar, select Data > Pipelines.
  2. Create a new custom pipeline or open an existing one for editing.
  3. In the Data Streams panel, click New.
  4. For Type, select Rippling Function.
  5. Select an existing Rippling function, or create a new one. The function is responsible for calling the external API and returning the data in the expected format.
  6. Configure the record details, including:
    • Record ID path: The field that uniquely identifies each record (used for deduplication).
    • Version path: Path to the record version field that tracks when each record was last changed.
    • Field mappings: Map the fields returned by your function to custom object fields.
  7. Publish the pipeline to start syncing data on a recurring schedule.

For more information about setting up custom pipelines, see the custom pipeline setup guide.

Resources​