Select + Select + Text

🔤 Combine two select fields with text.

1. Overview

This Interaction enables you to combine information from two "select" fields and a "text" field to create a new value.

2. Example

In the example below, the function fetches details of type and contact fields and combines them with the subject field to create a new name value.

async function handler(clev) {
    let actions = [];

    let typeSelect = clev.getValue("type");
    let typeObject = await clev.api.getEntry({
        recordId: "97234",
        responseType: "iov",
        id: typeSelect,
    });
    let typeName = typeObject.name; //console.log("typeField", typeName);
    
		let contactSelect = clev.getValue("contact")
    let contactObject = await clev.api.getEntry({
        recordId: "6633",
        responseType: "iov",
        id: contactSelect,
    });
    let contactFullName = contactObject["full-name"]; //console.log("contactField", contactFullName);
    let subject = clev.getValue("subject"); //console.log("subjectField", subject);
    let name = clev.getValue("name");

    const concatName = typeName + " - " + contactFullName + " - " + subject; //console.log("nameField", concatName);
    actions.push(clev.setValue('name', concatName));

    return clev.mergeAll(actions);
}

📌 Need Help?

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