# A syntax problematic

**URL:** <https://discourse.nodered.org/t/a-syntax-problematic/45862>\
**Category:** General\
**Created:** [18 May 2021 15:18 UTC](https://discourse.nodered.org/t/a-syntax-problematic/45862 "2021-05-18T15:18:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![edstobi](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@edstobi](https://discourse.nodered.org/u/edstobi)\
**Post date:** [18 May 2021 15:18 UTC](https://discourse.nodered.org/t/a-syntax-problematic/45862/1 "2021-05-18T15:18:31Z")

</div>

Hello Node Red forum  
I need your help with a syntax problematic

```auto
v_pco="63488";
v_txt="Hallo";
test=["p[3].b[6].pco=63488", "p[3].b[6].txt=\"Hallo\"" ];
msg.payload=test;

```

if I send this variable with msg.payload=test; it works.  
However, I would like to use v\_pco and v\_txt as a separate variable.  
But here I have a problem with the quotation  
How must the syntax be structured so that the data is passed on correctly?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 May 2021 15:26 UTC](https://discourse.nodered.org/t/a-syntax-problematic/45862/2 "2021-05-18T15:26:49Z")

</div>

> [@edstobi](#):
>
> However, I would like to use v\_pco and v\_txt as a separate variable.

```javascript
var v_pco="63488";
var v_txt="Hallo";
var test=[`p[3].b[6].pco=${v_pco}`, `p[3].b[6].txt="${v_txt}"`];
msg.payload=test;
return msg;

```

Alternatively...

```javascript
var v_pco="63488";
var v_txt="Hallo";
msg.payload= {
   pco: v_pco,
   txt: v_txt,
   pcoText: `p[3].b[6].pco=${v_pco}`,
   txtText: `p[3].b[6].txt="${v_txt}"`
}
return msg;

```

↑ This way, you can have text and values

---

<div class="post-metadata">

**Author:** ![edstobi](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@edstobi](https://discourse.nodered.org/u/edstobi)\
**Post date:** [18 May 2021 18:28 UTC](https://discourse.nodered.org/t/a-syntax-problematic/45862/3 "2021-05-18T18:28:59Z")

</div>

THX  
it was the missing $ 🥺

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [1 June 2021 18:29 UTC](https://discourse.nodered.org/t/a-syntax-problematic/45862/4 "2021-06-01T18:29:26Z")

</div>

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