# How to generate doc content from table?

**URL:** <https://connect.superhuman.com/t/how-to-generate-doc-content-from-table/20914>\
**Category:** Ask the Community\
**Created:** [January 24, 2021, 9:10am UTC](https://connect.superhuman.com/t/how-to-generate-doc-content-from-table/20914 "2021-01-24T09:10:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giuseppe\_Birardi](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/giuseppe_birardi/32/19003_2.png) [@Giuseppe\_Birardi](https://connect.superhuman.com/u/Giuseppe_Birardi)\
**Post date:** [January 24, 2021, 9:10am UTC](https://connect.superhuman.com/t/how-to-generate-doc-content-from-table/20914/1 "2021-01-24T09:10:11Z")

</div>

Is it possible to generate text from a table?

A minimum example would be something like:

Table:

![image](https://global.discourse-cdn.com/coda1/original/3X/a/9/a92173e0feef524fbc3e9ebd534dee89da9eb7bd.png)

Text pattern:

```
[Task Owner] in [Tasks] will take care of [Sub-tasks]

```

Desired Output:

“John in Task 1 will take care of Sub task 1”  
“Jeoff in Task 2 will take care of Sub task 2”  
“Jeoff in Task 2 will take care of Sub task 3”

I’m really new to Coda and don’t know it’s the right tool to achieve such functionalities.

---

<div class="post-metadata">

**Author:** ![Pch](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/pch/32/17688_2.png) [@Pch](https://connect.superhuman.com/u/Pch)\
**Post date:** [January 24, 2021, 2:45pm UTC](https://connect.superhuman.com/t/how-to-generate-doc-content-from-table/20914/2 "2021-01-24T14:45:28Z")

</div>

Hi there @Giuseppe_Birardi 😊 ! Welcome to Coda 😁 and to the Community 🎉 !

It is doable 😊 but depending where you want to put your desired output, it might require some adjustments 😊 .

So, in the sample below, I’ve kind of reproduce your screenshot and to get your desired results, in the table `Subtasks` I’ve created the `Reference` fields `[Tasks]` and `[Activity Owner]` both of which just show those info you’ve entered in your `Tasks` table 😊 .  
(Sorry, I’m enable to find another way to say this 😅 )

Now, on the canvas of my sample, you’ll see 3 very similar canvas formulas 😊 .

They do the same thing but one keep the reference to your `[Activity Owner]`, `[Tasks]` and `[Subtasks]` and the other don’t and the last one creates a `Bulleted List` 😊 .

The formulas looks like this :

`Subtasks.FormulaMap(Format("{1} in {2} will take care of {3}",CurrentValue.[Activity Owner],CurrentValue.Tasks,CurrentValue)).Join(Character(10))`

Put into words, it kind of says :  
For each subtasks ([FormulaMap()](https://coda.io/formulas#FormulaMap)) in the `Subtasks` table (each specific `Subtask` is represented by `CurrentValue`), follow this text pattern ([Format()](https://coda.io/formulas#Format)) and then, join them ([Join()](https://coda.io/formulas#Join)) using a `Character(10)` ([Character()](https://coda.io/formulas#Character)).

`Character n°10` in [Unicode](https://en.wikipedia.org/wiki/List_of_Unicode_characters#Control_codes) is the one for a line feed/Newline (so each `Subtasks` the formula uses begins with a newline, otherwise, the text is just displayed inline in the formula on the canvas 😊 )

And concerning the `Format()` formula, here :

- `{1}` = `CurrentValue.[Activity Owner]`  
(the owner of this specific `Subtask` in the list of all `Subtasks`)

- `{2}` = `CurrentValue.Tasks`  
(the `Task` linked to that specific `Subtask` in the list of all `Subtasks`)

- `{3}` = `CurrentValue`  
(the specific `Subtask` in the list of all `Subtasks`)

The list of all `Subtasks` being the `Subtasks` table 😊 .

And just in case, if you need more info about `FormulaMap()`, take a look at this topic [here](https://connect.superhuman.com/t/formulamap-when-and-where/18992) 😊 . It helped me a lot with this specific formula 😁 !

https://coda.io/embed/daFK8PRA2v/_sunaj?viewMode=embedplay&hideSections=true

---

<div class="post-metadata">

**Author:** ![Giuseppe\_Birardi](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/giuseppe_birardi/32/19003_2.png) [@Giuseppe\_Birardi](https://connect.superhuman.com/u/Giuseppe_Birardi)\
**Post date:** [January 24, 2021, 3:13pm UTC](https://connect.superhuman.com/t/how-to-generate-doc-content-from-table/20914/3 "2021-01-24T15:13:44Z")

</div>

Hi @Pch , thanks a lot for your examples! It really clarifies me how coda works with tables. I’ll try to dive into `FormulaMap()` and see if i can obtain my desired output.

---

<div class="post-metadata">

**Author:** ![Pch](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/pch/32/17688_2.png) [@Pch](https://connect.superhuman.com/u/Pch)\
**Post date:** [January 24, 2021, 3:23pm UTC](https://connect.superhuman.com/t/how-to-generate-doc-content-from-table/20914/4 "2021-01-24T15:23:50Z")

</div>

You’re Welcome @Giuseppe_Birardi 😊 !

Good luck with `FormulaMap()` 😉 !

Depending on how you use Coda, this is a formula you might never encounter or barely use, but it’s an important one and not necessarily the easiest to grasp 😶 .

Fortunately, the examples and explanations from other users in the topic I shared in my previous reply are very helpful 😊 .

---

<div class="post-metadata">

**Author:** ![Piet\_Strydom](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/piet_strydom/32/19269_2.png) [@Piet\_Strydom](https://connect.superhuman.com/u/Piet_Strydom)\
**Post date:** [January 26, 2021, 5:26am UTC](https://connect.superhuman.com/t/how-to-generate-doc-content-from-table/20914/5 "2021-01-26T05:26:22Z")

</div>

I got procedural proramming, then object orientation was ok. Never really got into functional, and now CODA has a complete different structure. I’m getting to old for this… 😉

---

<div class="post-metadata">

**Author:** ![Pch](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/pch/32/17688_2.png) [@Pch](https://connect.superhuman.com/u/Pch)\
**Post date:** [January 26, 2021, 10:36am UTC](https://connect.superhuman.com/t/how-to-generate-doc-content-from-table/20914/6 "2021-01-26T10:36:09Z")

</div>

> [@Piet\_Strydom](#):
>
> I’m getting to old for this… 😉

We’re never too old to learn new things 😉 …  
Life would be pretty boring if it was the case 😉 (IMHO).
