Autolinks

Autolinks allow you to trigger backend logic directly from a URL. When a user clicks the link, it executes a script (via a deployment), updates a record, and optionally redirects the user to a confirmation page.


How Autolinks Work

Step 1: Create a Script

Start by creating a script that defines:

  • What action should happen (e.g., approve or reject)
  • Which record to update
  • What response to return (e.g., message or redirect URL)

Below is an example script that updates a leave request to Approved:

async function script(C) {
    // Get autolink metadata (contains entryId from URL)
    const eventMetadata = C.getEventMetadata().autolinkUserData;

    // Fetch the entry using entryId from autolink
    const entry = await C.getEntry({
        entryId: eventMetadata.entryId,
        recordInternalId: "leave-requests",
    });

    // Set status to Approved (replace with your actual status ID)
    entry.status = ["APPROVED_STATUS_ID"];

    // Update the entry
    const response = await C.updateEntries({
        updates: [
            {
                value: entry,
                entryId: eventMetadata.entryId,
                recordInternalId: "leave-requests",
            },
        ],
    });

    // Return message + redirect
    return {
        message: "Leave Request Approved",
        redirection: {
            text: "Go to Clevero",
            url: "https://app.clevero.co",
        },
    };
}

What this script does:

  • Gets the current leave request.
  • Updates its status to Approved.
  • Returns a confirmation message and redirect user to the defined URL.

Step 2: Deploy the Script

Create a deployment for the script. This generates a deployment UID, which is required for the autolink URL.


Step 3: Generate the Autolink URL

Use the deployment details to create the URL that triggers the script when accessed.

Autolink URL structure

https://linkvero.clevero.co/clevero?instanceId={your-instance-id}&deploymentUid={your-deployment-uid}&entryId={record-id}&recordInternalId={your-record}

What you need to replace

FieldDescription
instanceIdYour instance name (identifies which environment the request is sent to)
deploymentUidUnique ID from your script deployment (determines which script is executed)
entryIdDynamic record ID (specifies which record will be updated)
recordInternalIdTarget record (the object/table where the update will happen)
Additional params (e.g., source=email)Optional query parameters that pass extra data to the script. These are only used if your script explicitly reads them.

Example

https://linkvero.clevero.co/clevero?instanceId=clevero&deploymentUid=6KScRwyp9niqWQB_ZRBrm&entryId=[100128529]&recordInternalId=leave-requests&test=abc

(Optional) 4. Add the Link to Email Template

Embed the URL into:

  • A text link
  • A button
  • An HTML block

When users click the link, the script runs automatically.

Text link example

<a href="https://linkvero.clevero.co/clevero?instanceId=clevero&deploymentUid=6KScRwyp9niqWQB_ZRBrm&entryId=100128529&recordInternalId=leave-requests&test=abc">
  Approve
</a>

Button example

<button onclick="window.location.href='https://linkvero.clevero.co/clevero?instanceId=clevero&deploymentUid=6KScRwyp9niqWQB_ZRBrm&entryId=100128529&recordInternalId=leave-requests'">
  Approve
</button>

📌 Need Help?

If you require assistance or encounter any issues, please don't hesitate to contact us for further support.