# Can we dynamically generate an image in app.ym?

**URL:** <https://community.yellow.ai/t/can-we-dynamically-generate-an-image-in-app-ym/2945>\
**Category:** Studio\
**Tags:** builder\
**Created:** [November 30, 2022, 6:34am UTC](https://community.yellow.ai/t/can-we-dynamically-generate-an-image-in-app-ym/2945 "2022-11-30T06:34:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![UdayaSudesh](https://avatars.discourse-cdn.com/v4/letter/u/7ab992/32.png) [@UdayaSudesh](https://community.yellow.ai/u/UdayaSudesh)\
**Post date:** [November 30, 2022, 6:34am UTC](https://community.yellow.ai/t/can-we-dynamically-generate-an-image-in-app-ym/2945/1 "2022-11-30T06:34:52Z")

</div>

The clients API will be providing the value and we will be required to bind it to an image and share it to the customer.  
Please suggest how can we achieve the same? Example screenshot attached.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/yellowmessenger1/original/2X/b/b7df84930eecf9ad39b2cbd13ab36143189b57a9.jpeg)

---

<div class="post-metadata">

**Author:** ![gautham](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.yellow.ai/gautham/32/1593_2.png) [@gautham](https://community.yellow.ai/u/gautham)\
**Post date:** [November 30, 2022, 6:44am UTC](https://community.yellow.ai/t/can-we-dynamically-generate-an-image-in-app-ym/2945/3 "2022-11-30T06:44:29Z")

</div>

@Subhrajit_Gupta I’m not familiar with app platform.

Do these node formats remain the same across both app.ym and cloud.ym?

---

<div class="post-metadata">

**Author:** ![Subhrajit\_Gupta](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.yellow.ai/subhrajit_gupta/32/1680_2.png) [@Subhrajit\_Gupta](https://community.yellow.ai/u/Subhrajit_Gupta)\
**Post date:** [November 30, 2022, 6:52am UTC](https://community.yellow.ai/t/can-we-dynamically-generate-an-image-in-app-ym/2945/4 "2022-11-30T06:52:39Z")

</div>

Hi @UdayaSudesh,  
What do you mean by dynamically generating image?  
Are you getting https image from API?

```auto
app.whatsapp.sendQuickReplies({
       title: 'Do you wish to receive updates from yellow.ai on WhatsApp?',
       image: 'https://cdn.yellowmessenger.com/pJr5TMMzaC3M1604657265596.png',
       options: [
           { title: 'Yes', text: 'Yes' },
           { title: 'No', text: 'No' },
       ],
   });
or 
app.whatsapp.sendCards(
       [{
           title: 'OPTIN Confirmation', image: imageUrl, text: `Do you wish to receive updates from yellow.ai on WhatsApp?`,
           actions: [
               {
                   title: 'Yes',
                   text: 'Yes'
               }
           ]
       }
       ]
for texts

```

You can use WA QuickReply for a single image yes/no prompt or use  
sendImage() for multiple in a loop images before the final

```auto
app.whatsapp.sendQuickReplies({
       title: 'Do you wish to receive updates from yellow.ai on WhatsApp?',
       options: [
           { title: 'Yes', text: 'Yes' },
           { title: 'No', text: 'No' },
       ],
   });

```

Quick reply prompt without image.  
The choice is yours.  
For multiple images, the delivery of the images might not be sequential.

---

<div class="post-metadata">

**Author:** ![Subhrajit\_Gupta](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.yellow.ai/subhrajit_gupta/32/1680_2.png) [@Subhrajit\_Gupta](https://community.yellow.ai/u/Subhrajit_Gupta)\
**Post date:** [November 30, 2022, 6:53am UTC](https://community.yellow.ai/t/can-we-dynamically-generate-an-image-in-app-ym/2945/5 "2022-11-30T06:53:13Z")

</div>

@gautham Hey, my bad. Missed that he asked for app. Taken down the prev post.

---

<div class="post-metadata">

**Author:** ![UdayaSudesh](https://avatars.discourse-cdn.com/v4/letter/u/7ab992/32.png) [@UdayaSudesh](https://community.yellow.ai/u/UdayaSudesh)\
**Post date:** [November 30, 2022, 11:09am UTC](https://community.yellow.ai/t/can-we-dynamically-generate-an-image-in-app-ym/2945/6 "2022-11-30T11:09:07Z")

</div>

Hi @Subhrajit_Gupta

If you could refer the screenshot in the question, the image (the red one with the piggy bank) will be shared by the customer. In the flow, we are expected to make an API call, that will give us the balance (not the image, only as a string). We have to append the value into the image on our end and send it to the user.

---

<div class="post-metadata">

**Author:** ![Subhrajit\_Gupta](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.yellow.ai/subhrajit_gupta/32/1680_2.png) [@Subhrajit\_Gupta](https://community.yellow.ai/u/Subhrajit_Gupta)\
**Post date:** [November 30, 2022, 11:24am UTC](https://community.yellow.ai/t/can-we-dynamically-generate-an-image-in-app-ym/2945/7 "2022-11-30T11:24:45Z")

</div>

Hi @UdayaSudesh,

```auto
app.sendImage('image.url', { mime: 'image/jpg', caption: `Name: ${steps.cg_detail.name}\nAge: ${steps.cg_detail.age}\nGender: ${steps.cg_detail.gender}\nMobile: ${steps.cg_detail.phone}\nVerified: ${steps.cg_detail.verified}`})

```

The caption will have the API details and image url will be the cdn file.  
After sending this Image you will configure the yes/no prompt.
