INNER CODE UNIT · TypeScript
selectedRow
google-marketing-solutions/feedgen · src/app.ts:142
const selectedRow = rows.filter(row => row[itemIdIndex] === itemId)[0];
const contextObject = Object.fromEntries(
headers
.filter((key: string) => key)
.map((key: string, index: number) => [key, selectedRow[index]])
);
return JSON.stringify(contextObject);
}
/**
* Fetch all unprocessed rows, optionally filtering out already processed ones.
*
* @param filterProcessed Whether to filter processed rows or not. Defaults to
* True.
* @returns JSON string corresponding to all unprocessed rows, with or without
* already processed ones. Needs to be a JSON string as Apps Script may end
* up nullifying the array if it contained a non-primitive data type.
*/