# Sequence of names based on inputs

**URL:** https://community.glideapps.com/t/sequence-of-names-based-on-inputs/72092
**Category:** Ask for Help
**Created:** [March 27, 2024, 2:50pm UTC](https://community.glideapps.com/t/sequence-of-names-based-on-inputs/72092 "2024-03-27T14:50:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Hugh\_van\_Niekerk](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hugh_van_niekerk/32/72491_2.png) [@Hugh\_van\_Niekerk](https://community.glideapps.com/u/Hugh_van_Niekerk)
#### Post date: [March 27, 2024, 2:50pm UTC](https://community.glideapps.com/t/sequence-of-names-based-on-inputs/72092/1 "2024-03-27T14:50:54Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [March 27, 2024, 3:24pm UTC](https://community.glideapps.com/t/sequence-of-names-based-on-inputs/72092/2 "2024-03-27T15:24:12Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Hugh\_van\_Niekerk](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hugh_van_niekerk/32/72491_2.png) [@Hugh\_van\_Niekerk](https://community.glideapps.com/u/Hugh_van_Niekerk)
#### Post date: [March 27, 2024, 4:07pm UTC](https://community.glideapps.com/t/sequence-of-names-based-on-inputs/72092/3 "2024-03-27T16:07:19Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [March 28, 2024, 1:03am UTC](https://community.glideapps.com/t/sequence-of-names-based-on-inputs/72092/4 "2024-03-28T01:03:53Z")

</div>

> [@Hugh\_van\_Niekerk](#):
>
> Thanks - interesting, is there somewhere I can learn how to do this?

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?

---

<div class="post-metadata">

### Author: ![Hugh\_van\_Niekerk](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/hugh_van_niekerk/32/72491_2.png) [@Hugh\_van\_Niekerk](https://community.glideapps.com/u/Hugh_van_Niekerk)
#### Post date: [March 28, 2024, 8:48am UTC](https://community.glideapps.com/t/sequence-of-names-based-on-inputs/72092/5 "2024-03-28T08:48:18Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [March 28, 2024, 11:26pm UTC](https://community.glideapps.com/t/sequence-of-names-based-on-inputs/72092/6 "2024-03-28T23:26:24Z")

</div>

> [@Hugh\_van\_Niekerk](#):
>
> Currently on the free plan - do you have concerns on the necessary functionality there?

Yes, because you can only do API calls on paid plans.
