Google Maps Scraper: extendOutputFunction failing to skip existing placeIds

Hello everyone, I'm using the Google Maps Scraper Actor in a workflow and attempting to implement logic to skip places that I have already collected in previous runs, based on their unique placeId. My setup involves querying a database for all previously collected placeIds and passing that list to the Actor's input as an array called customData.ignoreIds.

The Problem: The filtering logic is correctly defined in the Actor's input, but the Actor is still collecting and outputting places whose placeId is present in the ignoreIds list. I have verified the workflow is sequential (Database $\rightarrow$ JS $\rightarrow$ Actor).I have verified the ignoreIds array correctly contains the duplicate IDs in the Actor's input.The Actor log shows no errors related to the custom function.This suggests the extendOutputFunction is either not being executed or is failing silently within the Actor's environment.
My Implementation
"async ({ item, data, customData }) => {" +
" const pid = item.placeId item.place_id data.place_id));" +
" // Convert to a Set for faster lookup" +
" const ignore = Array.isArray(customData?.ignoreIds) ? new Set(customData.ignoreIds.map(String)) : new Set();" +
" " +
" // CRITICAL STEP: Skip item if its ID is in the ignore set" +
" if (pid && ignore.has(String(pid))) return null;" +
" " +
" return item;" +
"}"

My Questions are:
1- Is there a known restriction or limitation in the Google Maps Scraper Actor (or its underlying environment) that prevents the execution of the extendOutputFunction when passed as a string parameter, especially when using modern JS features like Set?

2- Has anyone successfully implemented this type of placeId skipping filter inside this Actor? If so, could you share a confirmed working function structure?
Was this page helpful?