Hi all - I have been banging my head against the wall over the last 4 days noodling around with ‘if’ formulas so hoping someone can help me here and relieve my pain!
I am trying to create a sequence of camps as my output, based on a set of inputs / conditions. This will then be used to be visualised on a calendar.
Inputs
- ColA: Camp Name
- ColB: Slot (Morning only, Evening only, Either) - when can a camp appear
- Col C: Number of appearances - number of times a camp can appear
- Col D: Calendar start date (each day has two slots, one for morning & one for evening)
Example of inputs & desired output below:
Inputs (with calendar start date of 27 March) - commas representing new columns
- A1, Morning only, 2
- A2, Either, 2
- A3, Either, 3
Desired Outputs - commas representing new columns
- 27 March 2024, Morning, A1
- 27 March 2024, Evening, A2
- 28 March 2024, Morning, A1
- 28 March 2024, Evening, A2
- 29 March 2024, Morning, A3
- 29 March 2024, Evening, A3
- 30 March 2024, Morning, A3
Really hoping someone can help me here! I feel there must be an elegant way to show this but am failing miserably.
First up I don’t think there’s a straightforward for a problem involving days and dynamic logic like this.
Do you have a limit on your inputs? Might be worth exploring using a JavaScript column to put out a JSON of mutations, then use those mutations to add rows.
Thanks - interesting, is there somewhere I can learn how to do this?
In terms of inputs - it will be dynamic but probably:
- Camps: <7
- Number of appearances: <10
- Slots: always the 3 mentioned baove
My thinking is you can describe your problem to ChatGPT or Claude, and ask them to write a JavaScript snippet.
Define well your input format, and what you want as the output.
Then try to use that snippet in the JavaScript column, trial and error until you get what you need.
Ideally, you would need a JSON result that is fit with Glide API’s format, so you can add rows later with an API call.
What plan are you on at the moment?
Currently on the free plan - do you have concerns on the necessary functionality there?
I have limited experience on JS - but agree this is probably the best way to tackle next. Will give that a crack.
Yes, because you can only do API calls on paid plans.