# For each formula

**URL:** <https://community.fibery.io/t/for-each-formula/3927>\
**Category:** Ideas & Features\
**Created:** [February 5, 2023, 2:55pm UTC](https://community.fibery.io/t/for-each-formula/3927 "2023-02-05T14:55:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![StevenSkillit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/stevenskillit/32/6084_2.png) [@StevenSkillit](https://community.fibery.io/u/StevenSkillit)\
**Post date:** [February 5, 2023, 2:55pm UTC](https://community.fibery.io/t/for-each-formula/3927/1 "2023-02-05T14:55:27Z")

</div>

It would be great to get a ForEach() formula.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [February 6, 2023, 6:22am UTC](https://community.fibery.io/t/for-each-formula/3927/2 "2023-02-06T06:22:29Z")

</div>

Can you give an example of how you might use it 🤔

---

<div class="post-metadata">

**Author:** ![StevenSkillit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/stevenskillit/32/6084_2.png) [@StevenSkillit](https://community.fibery.io/u/StevenSkillit)\
**Post date:** [February 6, 2023, 8:23am UTC](https://community.fibery.io/t/for-each-formula/3927/3 "2023-02-06T08:23:29Z")

</div>

We want to generate a url and need to add every relation to the url with a number. So every relation shoud get a number and other rules: app1=fibery&app2=make

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [February 6, 2023, 9:00am UTC](https://community.fibery.io/t/for-each-formula/3927/4 "2023-02-06T09:00:45Z")

</div>

Is it not possible to achieve this using `.Join()`

(maybe combined with some formula functions in the db containing the related items, if necessary)?

---

<div class="post-metadata">

**Author:** ![StevenSkillit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/stevenskillit/32/6084_2.png) [@StevenSkillit](https://community.fibery.io/u/StevenSkillit)\
**Post date:** [February 6, 2023, 9:21am UTC](https://community.fibery.io/t/for-each-formula/3927/5 "2023-02-06T09:21:03Z")

</div>

Yes, I managed everything apart from the numbering. So I would need the position.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [February 6, 2023, 9:39am UTC](https://community.fibery.io/t/for-each-formula/3927/6 "2023-02-06T09:39:13Z")

</div>

How is the position defined? Is it a characteristic of the related items?  
Or do you just want them numbered sequentially in the resultant URL?

---

<div class="post-metadata">

**Author:** ![StevenSkillit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/stevenskillit/32/6084_2.png) [@StevenSkillit](https://community.fibery.io/u/StevenSkillit)\
**Post date:** [February 6, 2023, 10:17am UTC](https://community.fibery.io/t/for-each-formula/3927/7 "2023-02-06T10:17:55Z")

</div>

Sequentially in the url would be great 👍🏻

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [February 6, 2023, 10:42am UTC](https://community.fibery.io/t/for-each-formula/3927/8 "2023-02-06T10:42:29Z")

</div>

I was worried you might say that!  
Yeah, there’s no easy way to create dynamic numbering within the join formula ☹

If the relationship is one-to-many, you could create a formula field in the ‘many’ database which will give you the sequence number of the entity, amongst all those that are linked to the same ‘one’:

`One.Many.Filter([Creation Date] < [This Many].[Creation Date]).Count() + 1`

Then you can use this in the `.Join()` function, something like this perhaps…

`Many.Join("app" + SequenceNumber + "=" + Name,"&")`
