Skip to main content
Question

Need Help Creating a Single Table in Zapier from a List of Data

  • June 5, 2025
  • 10 replies
  • 102 views

Forum|alt.badge.img

I'm trying to create a table in Zapier, but I'm facing an issue with my data format. The data I have comes as a list, and I want to display it in a single table format with columns for ID, Name, and Namespace. However, I'm currently unable to iterate over these individual fields correctly.

Instead of generating one table with all the rows, I'm ending up with a separate table for each ID, which is not what I want. Can anyone guide me on how to properly iterate over the parent object that contains this data so that I can create a single cohesive table?

Thanks in advance for your help!

 

 

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

10 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34032 replies
  • June 5, 2025

Hi ​@mjanwani 

Help us have more info by posting screenshots showing how your Zap Code step is configured in EDIT mode along with the format of the data used for the input variables.


Forum|alt.badge.img
  • Author
  • Beginner
  • 16 replies
  • June 5, 2025

 

output = {

tableLength: table.length,

rows: table

};


----------

I wanted to refer rows 
not rows.id


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34032 replies
  • June 5, 2025

@mjanwani 

Try asking ChatGPT for help with your javascript code.

Your inputs do not match your inputData.XXX declarations in the code.

 

 


Forum|alt.badge.img
  • Author
  • Beginner
  • 16 replies
  • June 5, 2025

Hi
I am not using expiringDates at this minute, that is ok,
rest piece is fine.
I also added the outputs I get from it.
 


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34032 replies
  • June 5, 2025

@mjanwani 

Did you try updating the code based on the feedback from AI?

 

 


Forum|alt.badge.img
  • Author
  • Beginner
  • 16 replies
  • June 5, 2025

I don’t think that is the issue, stll I updated- didn’t work


 

 


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34032 replies
  • June 5, 2025

@mjanwani 

For us to have current context, you need to post screenshots showing how your Zap steps are currently configured.

Also, post the data being used for the Code step inputs.


Forum|alt.badge.img
  • Author
  • Beginner
  • 16 replies
  • June 6, 2025

Hi 
Sure,
Kindly review 

 

I want this JS output in a table.
Thanks


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34032 replies
  • June 6, 2025

@mjanwani 

Try this code.

If you are still stuck, try asking ChatGPT for help.

Make sure to provide ChatGPT with

  • the actual javascript code.
  • the actual input var values:
    • JSON for dataResponse
    • comma delimited text string for expiringNamespaces
  • screenshots showing the generated output
const dataResponse = inputData.dataResponse || '{}';
const expiringNamespacesStr = inputData.expiringNamespaces || '';

// Parse inputs
const parsedData = JSON.parse(dataResponse);
const records = parsedData.records || [];
const expiringNamespaces = expiringNamespacesStr
.split(',')
.map(s => s.trim())
.filter(Boolean);

// Start building HTML table
let html = '<table border="1" cellpadding="4" cellspacing="0"><thead><tr>';
const headers = ['Id', 'PackageName', 'NamespacePrefix'];

// Add header row
for (const header of headers) {
html += `<th>${header}</th>`;
}
html += '</tr></thead><tbody>';

// Add data rows
for (const record of records) {
const namespacePrefix = record?.SubscriberPackage?.NamespacePrefix;
if (namespacePrefix && expiringNamespaces.includes(namespacePrefix)) {
html += '<tr>';
html += `<td>${record.Id || ''}</td>`;
html += `<td>${record.SubscriberPackage?.Name || ''}</td>`;
html += `<td>${namespacePrefix}</td>`;
html += '</tr>';
}
}

html += '</tbody></table>';

// Return full HTML string
return { htmlTable: html };

 


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 9676 replies
  • June 20, 2025

Hey ​@mjanwani, just checking in—did the code Troy shared help you to get it sorted? Or did you work with ChatGPT to get it solved?

If you did solve it, we’d love to hear what the solution was. This could be super helpful for others that might be attempting something similar. 🙏

Want to make sure you’re all set, so please keep us posted on how it’s going!