# How do i send multiple data items from the recives message block for webviewer extension

**URL:** https://community.thunkable.com/t/how-do-i-send-multiple-data-items-from-the-recives-message-block-for-webviewer-extension/2701339
**Category:** Questions about Thunkable X
**Tags:** help
**Created:** [November 14, 2023, 10:49pm UTC](https://community.thunkable.com/t/how-do-i-send-multiple-data-items-from-the-recives-message-block-for-webviewer-extension/2701339 "2023-11-14T22:49:32Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mubariz\_saeedthg](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mubariz\_saeedthg](https://community.thunkable.com/u/mubariz_saeedthg)
#### Post date: [November 14, 2023, 10:49pm UTC](https://community.thunkable.com/t/how-do-i-send-multiple-data-items-from-the-recives-message-block-for-webviewer-extension/2701339/1 "2023-11-14T22:49:32Z")

</div>

I’m currently working on a project where I use the Thunkable WebViewer Extension to communicate between my Thunkable app and a web page. I have successfully sent and received messages, but I’m facing a challenge when trying to send and receive multiple data items.

In my web app, I’m sending an object with several properties using the `ThunkableWebviewerExtension.postMessage` function. However, on the Thunkable side, when I receive the message in the “When WebViewer receives message” block, I’m struggling to access and display each individual property.

Here’s a simplified version of my current setup:

fetch(‘/run\_script’, {  
method: ‘POST’,  
headers: {  
‘Content-Type’: ‘application/json’  
},  
body: JSON.stringify({  
username,  
password  
})  
})  
.then(response =\> response.json())  
.then(data =\> {

```
                const outputArray = data.output;

                // Display each element separately
                document.getElementById('result').innerText =
                    `Smart Schedule Sync Complete. 
                    Token: ${outputArray[0]},
                    Username: ${outputArray[1]},
                    Cookies: ${outputArray[3]}`;

                ThunkableWebviewerExtension.postMessage(outputArray[0]);
                ThunkableWebviewerExtension.postMessage(outputArray[1]);
                

                    
            })
            .catch(error => {
                document.getElementById('result').innerText = "Error: " + error;
            })
            .finally(() => {
                loadingScreen.style.display = 'none';
                runScriptButton.disabled = false;
            });
    });

```

in thunkable it only shows the first data item ThunkableWebviewerExtension.postMessage(outputArray[0]);  
and also sets my other label that i have on thunkable to ThunkableWebviewerExtension.postMessage(outputArray[0]);

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [November 15, 2023, 3:49pm UTC](https://community.thunkable.com/t/how-do-i-send-multiple-data-items-from-the-recives-message-block-for-webviewer-extension/2701339/2 "2023-11-15T15:49:49Z")

</div>

Probably getting called too quick.

I would pass back the array of two items and parse it in the app

---

<div class="post-metadata">

### Author: ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)
#### Post date: [November 15, 2023, 4:48pm UTC](https://community.thunkable.com/t/how-do-i-send-multiple-data-items-from-the-recives-message-block-for-webviewer-extension/2701339/3 "2023-11-15T16:48:37Z")

</div>

Hi @mubariz_saeedthg, welcome to Thunkable! 🎉

Remember to check out our [Community Guidelines](https://community.thunkable.com/t/community-guidelines/78/) and [How to ask Great Questions v2.0](https://community.thunkable.com/t/how-to-ask-great-questions-v2-0/2689983/1) posts for tips on getting the best support from the Community on your issues.

---

<div class="post-metadata">

### Author: ![mubariz\_saeedthg](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mubariz\_saeedthg](https://community.thunkable.com/u/mubariz_saeedthg)
#### Post date: [November 16, 2023, 2:45pm UTC](https://community.thunkable.com/t/how-do-i-send-multiple-data-items-from-the-recives-message-block-for-webviewer-extension/2701339/4 "2023-11-16T14:45:07Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/5/f5efa172ad74b783609478ff07df71aca52a29af.png)

I need to send:  
Token: ${outputArray[0]},Username: ${outputArray[1]}, Password: ${outputArray[2]}

however when I try to send a post message from thunkable it only sends one message and if i needed to send all 3 i would just need one VERY long string variable

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [November 16, 2023, 6:29pm UTC](https://community.thunkable.com/t/how-do-i-send-multiple-data-items-from-the-recives-message-block-for-webviewer-extension/2701339/6 "2023-11-16T18:29:18Z")

</div>

> [@jared](#):
>
> I would pass back the array of two and parse it in the app

What’s the issue with this 👆

Post the object back to your app, dude. That’s what you’ll do here

---

<div class="post-metadata">

### Author: ![mubariz\_saeedthg](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mubariz\_saeedthg](https://community.thunkable.com/u/mubariz_saeedthg)
#### Post date: [November 17, 2023, 4:27am UTC](https://community.thunkable.com/t/how-do-i-send-multiple-data-items-from-the-recives-message-block-for-webviewer-extension/2701339/7 "2023-11-17T04:27:56Z")

</div>

> [@jared](#):
>
> I would pass back the array of two and parse it in the app

How would i do that exactly can u explain? with an example please?

---

<div class="post-metadata">

### Author: ![mubariz\_saeedthg](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mubariz\_saeedthg](https://community.thunkable.com/u/mubariz_saeedthg)
#### Post date: [November 17, 2023, 4:29am UTC](https://community.thunkable.com/t/how-do-i-send-multiple-data-items-from-the-recives-message-block-for-webviewer-extension/2701339/8 "2023-11-17T04:29:30Z")

</div>

> [@jared](#):
>
> > [@jared](#):
> >
> > I would pass back the array of two and parse it in the app
> 
> What’s the issue with this 👆
> 
> Post the object back to your app, dude. That’s what you’ll do here

> [@jared](#):
>
> I would pass back the array of two and parse it in the app

"What’s the issue with this 👆

Post the object back to your app, dude. That’s what you’ll do here"

whenever i try to parse in the app it just duplicates the first one it doesent give me two unique values

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [February 15, 2024, 4:30am UTC](https://community.thunkable.com/t/how-do-i-send-multiple-data-items-from-the-recives-message-block-for-webviewer-extension/2701339/9 "2024-02-15T04:30:03Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
