Hey everyone, I’m stuck with a Zapier automation I’m trying to set up. Here’s what I want to do:
- Trigger when a new PDF is added to a folder
- Use ChatGPT to extract info from the PDF (address, agent, phone, mobile, email)
- Process the data with some JavaScript
- Create a new Google Sheet
- Add the processed data to the sheet
Everything’s working fine up to step 4, but I’m having trouble with the last part. When I create new spreadsheet rows, all the data gets dumped into one cell instead of being split across columns.
Has anyone encountered this issue before? How can I get Zapier to put each piece of information into its own column? I’d appreciate any tips or tricks.
Here’s a simplified version of the JavaScript output:
[
['123 Main St, Anytown, USA', 'John Doe', '555-1234', '555-5678', '[email protected]'],
['456 Oak Rd, Somewhere, USA', 'Jane Smith', '555-4321', '555-8765', '[email protected]']
]
I want each item to appear in separate columns in the Google Sheet. Any ideas?
hey noah, i’ve run into this before. make sure ur using the ‘create spreadsheet row’ action in zapier, not ‘append to sheet’. then map each field individually - address to column A, agent to B, etc. that should fix it. let me know if u need more help!
Noah, I’ve encountered this issue before. The key is to use the ‘Create Spreadsheet Row’ action in Zapier and map each field individually. In the Zapier interface, you’ll see options to map each element from your JavaScript output to specific columns. For instance, map the first element (address) to column A, the second (agent name) to column B, and so on. This ensures each piece of data goes into its own column.
Also, double-check your JavaScript output. Make sure it’s returning an array of arrays, not a single string. If the data structure is correct, Zapier should be able to interpret it properly when mapped to individual columns.
If you’re still having trouble, you might need to adjust your JavaScript to output an object instead of an array. This can make it easier for Zapier to understand which data goes where.
I’ve faced a similar issue with Zapier and Google Sheets. The solution was to ensure that each element in my output array was explicitly mapped to its corresponding column. Instead of dumping the entire array into one field, the key was to assign, for instance, the address from the first element to the Address column, the agent from the second element to the Agent column, and so on.
This approach helped Zapier distribute the data across the columns as intended. It’s also important to verify that your JavaScript step outputs the data in a format that Zapier can parse without ambiguity; otherwise, it might not split the data correctly.