# API Connector POST with dynamic data (postmark email)

**URL:** <https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051>\
**Category:** APIs\
**Created:** [March 25, 2021, 2:40pm UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051 "2021-03-25T14:40:13Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![nemanja.rilakovic](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@nemanja.rilakovic](https://forum.bubble.io/u/nemanja.rilakovic)\
**Post date:** [March 25, 2021, 2:40pm UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/1 "2021-03-25T14:40:13Z")

</div>

Hello!

I’m trying to send your some data from a repeating group to an email template in Postmark.

In the template there are some repeating fields that are set up this way:

```
"calculation_details": [
	{
		"description": "description_Value",
		"amount": "amount_Value"
	}
]

```

In the API connector body, I have entered following:

```
    "calculation_details": [
	{
		"description": "<description_Value>",
		"amount": "<amount_Value>"
	}
]

```

And then down in the parameters I can set the description\_Value and amount\_Value like in the screenshot.

 ![Screenshot 2021-03-25 at 15.38.33](https://us1.discourse-cdn.com/bubble/original/3X/9/a/9af4c8505be0f3ed8ca53021f1f39c30650c75dd.jpeg)

When I do a manual call this works, the email gets sent with parameters to the template. But how Do I send these parameters from the workflow from the repeating group?

This will be a list of items chosen from a checklist where the user should get the list via e-mail.

Plese help!

---

<div class="post-metadata">

**Author:** ![johnny](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/johnny/32/203020_2.png) [@johnny](https://forum.bubble.io/u/johnny)\
**Post date:** [March 25, 2021, 2:42pm UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/2 "2021-03-25T14:42:24Z")

</div>

Hey there @nemanja.rilakovic,

Have you unchecked “private?”

---

<div class="post-metadata">

**Author:** ![Jici](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jici/32/30722_2.png) [@Jici](https://forum.bubble.io/u/Jici)\
**Post date:** [March 25, 2021, 2:42pm UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/3 "2021-03-25T14:42:27Z")

</div>

you need to uncheck “private” for each parameters. They will be available in the workflow

---

<div class="post-metadata">

**Author:** ![nemanja.rilakovic](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@nemanja.rilakovic](https://forum.bubble.io/u/nemanja.rilakovic)\
**Post date:** [March 25, 2021, 2:53pm UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/4 "2021-03-25T14:53:19Z")

</div>

Awesome!! Thanks guys, now it works! thanks for the quick response.

Now I arrived at the next issue. In the email template the chosen items appears on the same row like this:

 ![Screenshot 2021-03-25 at 15.47.24](https://us1.discourse-cdn.com/bubble/original/3X/4/d/4d69a1cd08a27670b7cb8433aedba6db842483fb.jpeg)

This might be an issue in the template maybe. I’m using the basic template from postmark.

---

<div class="post-metadata">

**Author:** ![nemanja.rilakovic](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@nemanja.rilakovic](https://forum.bubble.io/u/nemanja.rilakovic)\
**Post date:** [March 25, 2021, 2:55pm UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/5 "2021-03-25T14:55:04Z")

</div>

This is how the HTML template looks like.

 ![Screenshot 2021-03-25 at 15.54.29](https://us1.discourse-cdn.com/bubble/original/3X/2/3/2389e402636eceb5ffb98b031fbeed49c2e521e4.jpeg)

---

<div class="post-metadata">

**Author:** ![nemanja.rilakovic](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@nemanja.rilakovic](https://forum.bubble.io/u/nemanja.rilakovic)\
**Post date:** [March 25, 2021, 3:05pm UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/6 "2021-03-25T15:05:07Z")

</div>

It seems like all of them are getting into the same table row.

---

<div class="post-metadata">

**Author:** ![Jici](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jici/32/30722_2.png) [@Jici](https://forum.bubble.io/u/Jici)\
**Post date:** [March 25, 2021, 3:07pm UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/7 "2021-03-25T15:07:30Z")

</div>

Actually, you are putting everyting in the same parameters.  
But in this case, you need to have an object {} for each line  
Example:  
“calculation\_details”:[  
{“description”:\<description\_value\>“,“amount”:”\<amount\_value\>“},{“description”:\<description\_value\>”,“amount”:“\<amount\_value\>”}]  
this mean 2 line.  
But if you have dynamic data that will change on how many item you will have, you will need to use a more complex option  
You will set in API Connector: “calculation\_details”:[\<calc\_detailss],  
And in the workflow, for this part, you will use :format as text.

Please read this post for a few informations about that

> [@\[New Feature\] '...:format as text' operator on lists](http://forum.bubble.io/t/new-feature-format-as-text-operator-on-lists/124248):
>
> Hello everyone! Formally announcing the release of this feature. Some of you have already noticed and used it but we were a bit quiet about it as we wrapped up some QA tasks. This operator can be applied to a list of things to display its content in a custom format. You can choose a delimiter for your list, and the content to show per list item. All items will share the format that you specify. For example, if you have a list of names, you can choose to display “This name” in bold with a space…

---

<div class="post-metadata">

**Author:** ![nemanja.rilakovic](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@nemanja.rilakovic](https://forum.bubble.io/u/nemanja.rilakovic)\
**Post date:** [March 25, 2021, 3:43pm UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/8 "2021-03-25T15:43:06Z")

</div>

Thanks @Jici, now it works perfect!!

---

<div class="post-metadata">

**Author:** ![ryanck](https://avatars.discourse-cdn.com/v4/letter/r/13edae/32.png) [@ryanck](https://forum.bubble.io/u/ryanck)\
**Post date:** [March 25, 2021, 5:47pm UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/9 "2021-03-25T17:47:21Z")

</div>

Do you mind sharing how did you achieved it?

Thanks!

---

<div class="post-metadata">

**Author:** ![nemanja.rilakovic](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@nemanja.rilakovic](https://forum.bubble.io/u/nemanja.rilakovic)\
**Post date:** [March 25, 2021, 6:35pm UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/10 "2021-03-25T18:35:29Z")

</div>

Sure!

In the API-connector I substituted the whole JSON part that will loop with a handle like this (compare it with the picture in my first post and you will get the substitution):

 ![Screenshot 2021-03-25 at 19.29.20](https://us1.discourse-cdn.com/bubble/original/3X/c/3/c39481f29abd1858cd69de42daab52ca41786581.jpeg)

So the “calculation\_details” : [\<calculation\_details\>]

And then in the workflow you find the repeating group or a list you want to parse in there and use :format\_as\_text

Then in the text field content you put in the whole expression that should loop, and just substitute the variables with “add dynamic content” lite this:

 ![Screenshot 2021-03-25 at 19.27.08](https://us1.discourse-cdn.com/bubble/original/3X/d/c/dcf9bf22dc2c71264ff5a3317d528e125eaff799.jpeg)

This way the JSON data gets in the correct way into the HTML template.

I hope this gave you some more info, sorry for the swedish variable names.

---

<div class="post-metadata">

**Author:** ![johnny](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/johnny/32/203020_2.png) [@johnny](https://forum.bubble.io/u/johnny)\
**Post date:** [March 25, 2021, 7:18pm UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/11 "2021-03-25T19:18:00Z")

</div>

Yup! So glad they added the :format as text functionality

---

<div class="post-metadata">

**Author:** ![ryanck](https://avatars.discourse-cdn.com/v4/letter/r/13edae/32.png) [@ryanck](https://forum.bubble.io/u/ryanck)\
**Post date:** [March 25, 2021, 7:23pm UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/12 "2021-03-25T19:23:10Z")

</div>

Thanks for the explanation 🙌.

Why is there so much space between the “{” and the “description”? Also between the “,” and the “amount”?

---

<div class="post-metadata">

**Author:** ![nemanja.rilakovic](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@nemanja.rilakovic](https://forum.bubble.io/u/nemanja.rilakovic)\
**Post date:** [March 26, 2021, 4:12am UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/13 "2021-03-26T04:12:53Z")

</div>

There is no reason, it just turned out this way when I cut/pasted the code from the API connector. 😂 Just ignore that!

---

<div class="post-metadata">

**Author:** ![Alter345](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Alter345](https://forum.bubble.io/u/Alter345)\
**Post date:** [August 26, 2022, 9:27am UTC](https://forum.bubble.io/t/api-connector-post-with-dynamic-data-postmark-email/143051/14 "2022-08-26T09:27:10Z")

</div>

@nemanja.rilakovic @ryanck  
Hi there ! I’m struggling on this one ;( I read your post, but it seems i cannot make it works … if you have any idea, that would be nice ^^  
The email i’m trying to send works well with postmark, but when i try to add a list as you have set up, i do not receive any email … Attached you can check my set up  
any clue ? many thanks

 ![Screen Shot 2022-08-26 at 11.21.04](https://us1.discourse-cdn.com/bubble/original/3X/7/8/78152bc06c38f97b8753f704a8ee44783740db6c.png)  
 ![Screen Shot 2022-08-26 at 11.24.54](https://us1.discourse-cdn.com/bubble/original/3X/f/9/f9619102de32ea7391273f5dd7555c4569ab543f.png)  
 ![Screen Shot 2022-08-26 at 11.22.33](https://us1.discourse-cdn.com/bubble/original/3X/3/5/35c5a153d273826f97e52673173073af743e9212.png)  
 ![Screen Shot 2022-08-26 at 11.23.08](https://us1.discourse-cdn.com/bubble/original/3X/b/c/bc8d0e43f97cff6e193a2566cffe7d58915a7f81.png)  
 ![Screen Shot 2022-08-26 at 11.22.45](https://us1.discourse-cdn.com/bubble/original/3X/b/5/b57ec30103c7045bd89536cfd9d77eecb8678c1d.png)
