Help

Repeating Group use script input

Topic Labels: Automations
Solved
Jump to Solution
374 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Giuseppe
4 - Data Explorer
4 - Data Explorer

Hey, 

I have a problem with a repeating group, it does not accept my script as input source.

 

// Load and filter table
const table = base.getTable("Contact List");

table.selectRecordsAsync({ fields: ["First Name", "Last Name", "Title", "Email", "Phone Number", "Organization", "Address", "City", "Region", "Country", "Zip Code", "Marketing Consent", "Tags"] })
    .then(queryResult => {
        const queryRecords = queryResult.records.filter(record => (
            record.getCellValueAsString("Marketing Consent") === "true" &&
            (record.getCellValueAsString("Tags") === "Fliese des Monats")
        ));
        const dataArray = queryRecords.map(record => ({
            "firstName": record.getCellValueAsString("First Name"),
            "lastName": record.getCellValueAsString("Last Name"),
            "title": record.getCellValueAsString("Title"),
            "email": record.getCellValueAsString("Email"),
            "phoneNumber": record.getCellValueAsString("Phone Number"),
            "organization": record.getCellValueAsString("Organization"),
            "address1": record.getCellValueAsString("Address"),
            "city": record.getCellValueAsString("City"),
            "region": record.getCellValueAsString("Region"),
            "country": record.getCellValueAsString("Country"),
            "zipCode": record.getCellValueAsString("Zip Code"),
            "marketingConsent": record.getCellValueAsString("Marketing Consent")
        }));
        console.log(dataArray);
    })
    .catch(error => {
        console.error('Fehler beim Abrufen der Datensätze:', error);
    });

 

1 Solution

Accepted Solutions
Sho
11 - Venus
11 - Venus
output.set is required

 

output.set("dataArray",dataArray);

 

Output - Airtable Scripting

See Solution in Thread

1 Reply 1
Sho
11 - Venus
11 - Venus
output.set is required

 

output.set("dataArray",dataArray);

 

Output - Airtable Scripting