Skip to main content
What happens when I run a test

Help Creating Multiple Swim Sessions in Airtable Based on Date Range

What I'm Trying to Do

I'm building a Zap to create multiple swim lesson sessions in my Airtable base. I need to generate recurring swim sessions on specific days of the week (like Sundays) within a date range.

Here's my workflow:

  1. Trigger: New record in my "session openings" table in Airtable
  2. JavaScript step: Generate sessions for each Sunday between start date and end date
  3. Loop step: Create individual records for each session in my "SUMMER SCHEDULE" table

Current Setup

  1. Trigger: When a new record is created in my "session openings" table with:
    • Instructor (linked record)
    • Location (text)
    • Start Date (date/time)
    • End Date (date/time)
    • Repeating (single select - "Sunday")
  2. Code by Zapier: JavaScript to generate all sessions between dates
    • This successfully generates 4 sessions (one for each Sunday)
    • Output includes: Session dates, day of week, instructor, location, etc.
  3. Create Loop From Text: Trying to loop through my sessions
    • This is where I'm stuck - I can only get it to create one session

Problem I'm Having

My JavaScript generates multiple sessions correctly (I can see all 4 Sundays in the output), but I can't figure out how to properly set up the "Create Loop From Text" step to iterate through each session and create separate records in Airtable.

The JavaScript output looks like this:

 

 

 

Sessions Count: 4
Sessions Text: [JSON data for all 4 sessions]
firstSession: [Details of first session]

Questions

  1. How do I correctly set up "Values to Loop" in the Create Loop From Text step to process all 4 sessions?
  2. Should I modify my JavaScript to output data differently to work better with Zapier's looping functionality?
  3. Is there a simpler approach to creating multiple recurring sessions based on a date range and day of week?

I appreciate any guidance on getting this automation working correctly. Thanks!

Hi ​@Sydnee Merchant 

Your first screenshots shows you are using the “preview” variables from the looping step, which should not be used.

You should use this Zap action: Looping - Create Loop from Line Items

 

Help links for using Looping: https://zapier.com/apps/looping/integrations#help

  • You must not use the preview_loop_values field from the loop test in your Zap. It is for preview purposes only and does not appear in actual Zap runs.

 


@Sydnee Merchant 

ALTERNATIVE

If you will be creating 10 or less records, then you can use this Zap action: Airtable - Create Records

This means you will NOT need to use the Looping step.

Just map the variables from the Code step to the Airtable step.

 


will that work if it is a list? so i am creating about 8 records but each one has a different date. 


@Sydnee Merchant 

Zap action: Airtable - Create Records

Description: Create up to 10 new records (supports line items).

 

That means the Zap step can handle an array of up to 10 items.


I Appreciate your responses, I am so frustrated I could cry 😭


@Sydnee Merchant 

You can hire help, there is a directory of Certified Zapier Experts: https://zapier.com/experts


Hey there, ​@Sydnee Merchant 👋

I just stumbled across this and wanted to check how you’re getting on. Did you reach out to a Zapier Expert to get it sorted, or did you manage to get it working with the Create Records action Troy suggested?

If you’re still stuck at all, I’d be happy to help get things up and running. 🙂

Looking forward to hearing from you!