Sep 04, 2023 03:30 AM
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);
});
Solved! Go to Solution.
Sep 04, 2023 05:43 AM
output.set("dataArray",dataArray);
Sep 04, 2023 05:43 AM