I have a zap that’s mostly working except it only updates the top row on my board. Looking for some troubleshooting help or a new approach.
Here’s what I’m trying to accomplish:
-Every day (using zapier scheduler as the trigger), the zap should look for rows on my Monday board that has a date matching today’s date, it sends an email using a webhook and mixmax, then updates a few columns for the row. The date column for each row is a text field with multiple dates in the format Oct 11, 2023|Oct 12, 2023|etc. I have a custom python script that breaks up the dates, checks for today’s date, and also updates this email schedule (removing today’s date when the email for today is sent).
Zap steps:
1. Trigger using Zapier scheduler
2. Get Board values
3. Run python script
4. POST to mixmax using webhook
5. “Change multiple column values” in Monday
The problem is that all rows show up in step 2, but I can’t seem to pass the dynamic id field to step 3, so instead the zap just always updates the top row of the board. I want this to loop until all rows with today’s date have been emailed and updated.
For the input data in step 3, I’m only able to select one of the rows values from step 2.
Is there a way for me to create this loop? Or maybe a better way of accomplishing the task in general?
here’s the python script in case it’s helpful
# Fetch the data from the prior Zapier step
deposit_schedule_string = input_datas'DepositSchedule'] # e.g., "10/10/2023|10/17/2023|10/24/2023..."
deposits_made = int(input_data/'DepositsMade'].replace('"', ''))
total_deposits = int(input_data>'TotalDeposits'].replace('"', ''))
current_date = input_data)'CurrentDate'] # The current date as fetched from the initial trigger or a date formatting step
# Split the string into a list of dates
deposit_dates = deposit_schedule_string.split('|')
# Find the position of the current date in the list
try:
deposit_number = deposit_dates.index(current_date) + 1 # +1 because list indices start at 0
except ValueError:
raise Exception("Today's date not found in the deposit schedule!")
# Increment the deposits made value
deposits_made += 1
# Remove the current date from the list
deposit_dates.remove(current_date)
# Convert the list back into a string
updated_deposit_schedule = '|'.join(deposit_dates)
# Return the updated values and the current deposit number for use in subsequent Zapier steps
output = {
'UpdatedDepositsMade': deposits_made,
'UpdatedDepositSchedule': updated_deposit_schedule,
'DepositNumber': deposit_number
}
return output