Hi Make Community,
I’m stuck on an issue trying to create Google Calendar events from a scenario where the day is provided as a text string (like “Friday”) instead of a number.
What I’m doing:
I receive booking data (parsed from JSON) where the day is a string, e.g. “Friday”.
I want to calculate the date of the next occurrence of that weekday (e.g., the next Friday) and send this as the Start Date to Google Calendar.
My formula uses find() to convert “Friday” into its index in the week, but I keep getting the error:
BundleValidationError: Invalid date in parameter ‘start’
I tried using formulas like:
find([“sunday”,“monday”,“tuesday”,“wednesday”,“thursday”,“friday”,“saturday”]; lower(data.day))
…and mapping the variable in formula mode, but the output is still either the raw formula or empty.
I’m not sure if I’m inserting the data.day variable correctly as a token, or if my approach is right.
What I’ve tried:
Switching the variable field to formula mode (<> icon).
Using lower/upper case matching.
Using Set Variable to debug the find() result before using it in the final date calculation.
What happens:
Instead of a number, sometimes I get the formula as plain text.
When I use the full formula for Start Date in Google Calendar, I keep getting the invalid date error.
My questions:
-
How do I properly insert the data.day value as a token inside my formula (not as plain text)?
-
Is my approach to converting “Friday” to 5 (using find([…]; lower(data.day))) correct?
-
Any examples for how to safely turn a weekday string into a usable number for date calculations in Make?
-
Any best practices for avoiding “plain text” mode or formula mode issues in Make’s Set Variable or Calendar modules?
Screenshot attached for reference.
Thanks so much for any tips or sample
I’ve been stuck for a while and would appreciate step-by-step help.