# Sending Integer through JSON in HTTP request piece

**URL:** <https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366>\
**Category:** Need help\
**Created:** [June 8, 2024, 3:05pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366 "2024-06-08T15:05:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![SCH\_Hiring](https://community.activepieces.com/user_avatar/community.activepieces.com/sch_hiring/32/594_2.png) [@SCH\_Hiring](https://community.activepieces.com/u/SCH_Hiring)\
**Post date:** [June 8, 2024, 3:05pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/1 "2024-06-08T15:05:54Z")

</div>

{  
“custom\_fields”: {  
“cf\_date”: “{{step\_2[‘assessmentCompletedDateTime’]}}”,  
“cf\_url”: “{{step\_2[‘descriptiveReportPageUrl’]}}”,  
“cf\_job\_title”: “{{step\_2[‘associatedPositionTitle’]}}”,  
“cf\_scoring\_method”: “{{step\_2[‘scoringMethod’]}}”,  
“cf\_pattern”: {{step\_3[1]}},  
“cf\_ssc”: 65,  
“cf\_scsc”: 30,  
“cf\_sss”: 28  
}

}

When using data from previous steps, it does not allow me to post the data without quotation marks, which is required for integer.

 ![image](https://community.activepieces.com/uploads/default/original/2X/1/13b0e4c583d82814880d611056cbf2131968a1e3.png)

---

<div class="post-metadata">

**Author:** ![abuaboud](https://community.activepieces.com/user_avatar/community.activepieces.com/abuaboud/32/7285_2.png) [@abuaboud](https://community.activepieces.com/u/abuaboud)\
**Post date:** [June 8, 2024, 5:10pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/2 "2024-06-08T17:10:33Z")

</div>

In line 15, you should add add cf\_pattern between double quotes, If there is single variable It will be similar to original data type It was.

You can also write JS function inside {{ }}

So you can also do the following `"{{Number(step_3[1])}}" `

Edit: fixed the parenthesis error below

---

<div class="post-metadata">

**Author:** ![NotMy1RealName](https://community.activepieces.com/user_avatar/community.activepieces.com/notmy1realname/32/2949_2.png) [@NotMy1RealName](https://community.activepieces.com/u/NotMy1RealName)\
**Post date:** [June 8, 2024, 5:26pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/3 "2024-06-08T17:26:47Z")

</div>

To be clear, adding the JS function {{ }} will import the data from previous step without quotes?

What does Number do? I noticed there was no closing paranthesis, is that necessary or an error?

---

<div class="post-metadata">

**Author:** ![abuaboud](https://community.activepieces.com/user_avatar/community.activepieces.com/abuaboud/32/7285_2.png) [@abuaboud](https://community.activepieces.com/u/abuaboud)\
**Post date:** [June 8, 2024, 5:39pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/4 "2024-06-08T17:39:02Z")

</div>

Hi @NotMy1RealName

Yes Correct!

You can test with try to use “Data Mapper Piece” → and press Test to see the actual output, and thank you I have fixed the snippet.

Number is to change the type to Number in case it wasn’t a number but a text.

---

<div class="post-metadata">

**Author:** ![SCH\_Hiring](https://community.activepieces.com/user_avatar/community.activepieces.com/sch_hiring/32/594_2.png) [@SCH\_Hiring](https://community.activepieces.com/u/SCH_Hiring)\
**Post date:** [June 9, 2024, 3:32am UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/5 "2024-06-09T03:32:31Z")

</div>

Thank you for your code but it still doesn’t work.

I have tried parsing the result using data mapper and code but the problem is in the double quotes. The URL I am posting to needs the data without the double quotes to recognize it as a number. The http piece gives me an invalid json error if I don’t include the double quotes.

I also apologize for the multiple posts, but it does not allow me to post more than one screenshot.

The server api JSON validator is giving an issue where it doesn’t allow any data to be sent without using quotation marks “”. I tried it with number{{ and directly and it still gives the same issue.

 ![image](https://community.activepieces.com/uploads/default/original/2X/5/52821939814f1c847c349d493aafeb230f33cd90.png)

---

<div class="post-metadata">

**Author:** ![SCH\_Hiring](https://community.activepieces.com/user_avatar/community.activepieces.com/sch_hiring/32/594_2.png) [@SCH\_Hiring](https://community.activepieces.com/u/SCH_Hiring)\
**Post date:** [June 9, 2024, 3:33am UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/6 "2024-06-09T03:33:09Z")

</div>

![image](https://community.activepieces.com/uploads/default/original/2X/e/e3ebe4d566c3a503089fdc4b67fef72520bc5042.png)  
this is the output using data step

---

<div class="post-metadata">

**Author:** ![SCH\_Hiring](https://community.activepieces.com/user_avatar/community.activepieces.com/sch_hiring/32/594_2.png) [@SCH\_Hiring](https://community.activepieces.com/u/SCH_Hiring)\
**Post date:** [June 9, 2024, 3:33am UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/7 "2024-06-09T03:33:39Z")

</div>

I also tried this but it did not work

 ![image](https://community.activepieces.com/uploads/default/original/2X/4/4af1969fbcd0ea3e555aadf84cb77ce39ab2ca68.png)

---

<div class="post-metadata">

**Author:** ![Bram](https://community.activepieces.com/user_avatar/community.activepieces.com/bram/32/2705_2.png) [@Bram](https://community.activepieces.com/u/Bram)\
**Post date:** [June 9, 2024, 9:15am UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/8 "2024-06-09T09:15:08Z")

</div>

Did you try to put the numbers with double quotes?

“20”

---

<div class="post-metadata">

**Author:** ![Abdul](https://community.activepieces.com/user_avatar/community.activepieces.com/abdul/32/1544_2.png) [@Abdul](https://community.activepieces.com/u/Abdul)\
**Post date:** [June 9, 2024, 10:17am UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/9 "2024-06-09T10:17:49Z")

</div>

Hello, could you please show use the ssc value in step\_8 ? maybe the value is a float and you need to make it an integer instead.

---

<div class="post-metadata">

**Author:** ![SCH\_Hiring](https://community.activepieces.com/user_avatar/community.activepieces.com/sch_hiring/32/594_2.png) [@SCH\_Hiring](https://community.activepieces.com/u/SCH_Hiring)\
**Post date:** [June 9, 2024, 2:45pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/10 "2024-06-09T14:45:28Z")

</div>

If I put 30 in double quotes it gives me the same error

 ![image](https://community.activepieces.com/uploads/default/original/2X/b/bb30a169fa1b64215d30a4acbd28df705f261800.png)

---

<div class="post-metadata">

**Author:** ![SCH\_Hiring](https://community.activepieces.com/user_avatar/community.activepieces.com/sch_hiring/32/594_2.png) [@SCH\_Hiring](https://community.activepieces.com/u/SCH_Hiring)\
**Post date:** [June 9, 2024, 2:47pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/11 "2024-06-09T14:47:17Z")

</div>

The output in the previous step is just a number

 ![image](https://community.activepieces.com/uploads/default/original/2X/5/5f04fa8896f83280a3b00c6a39f4fd23040431f1.png)

---

<div class="post-metadata">

**Author:** ![Abdul](https://community.activepieces.com/user_avatar/community.activepieces.com/abdul/32/1544_2.png) [@Abdul](https://community.activepieces.com/u/Abdul)\
**Post date:** [June 10, 2024, 7:03am UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/12 "2024-06-10T07:03:45Z")

</div>

sorry, but I don’t see an “ssc” value there.

---

<div class="post-metadata">

**Author:** ![SCH\_Hiring](https://community.activepieces.com/user_avatar/community.activepieces.com/sch_hiring/32/594_2.png) [@SCH\_Hiring](https://community.activepieces.com/u/SCH_Hiring)\
**Post date:** [June 10, 2024, 6:47pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/13 "2024-06-10T18:47:01Z")

</div>

![image](https://community.activepieces.com/uploads/default/original/2X/9/9e16d69ec404c311b86d5e3268805b845d4506eb.png)  
It comes from the circled mscore value

---

<div class="post-metadata">

**Author:** ![JulianJay](https://community.activepieces.com/user_avatar/community.activepieces.com/julianjay/32/1140_2.png) [@JulianJay](https://community.activepieces.com/u/JulianJay)\
**Post date:** [June 11, 2024, 7:36am UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/14 "2024-06-11T07:36:00Z")

</div>

I have a similar problem, followed the thread but cannot seem to fix it.  
 ![image](https://community.activepieces.com/uploads/default/original/2X/6/6894c641b09ed737d1119e00681b19f0259e8073.png)

It returns an empty list of and no categories are added to the post:  
“categories”: ,

Categoy IDs should be an integer list, such as [4, 23]:  
 ![image](https://community.activepieces.com/uploads/default/original/2X/f/f0e92b14b16e4f0e0980494953844a0241d531d4.png)

Inserting it just as a normal JSON results in following Error:  
 ![image](https://community.activepieces.com/uploads/default/original/2X/c/c3fd3d054bad207620e3a9f2914b378c21ef5def.png)

 ![image](https://community.activepieces.com/uploads/default/original/2X/0/0f067bfa7755c2eee06862a49e1eea6849fa195c.png)

Any hints on how to pass an integer list into JSON stemming from a variable in ActivePieces?  
Thanks!

---

<div class="post-metadata">

**Author:** ![Bram](https://community.activepieces.com/user_avatar/community.activepieces.com/bram/32/2705_2.png) [@Bram](https://community.activepieces.com/u/Bram)\
**Post date:** [June 11, 2024, 12:22pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/15 "2024-06-11T12:22:45Z")

</div>

Hi @JulianJay ,

You are working with wordpress right? try it manually first but I think your solution is adding a space between the comma and the new number.  
“19, 22” instead of together. no need for hooks either! just the numbers seprates and a comma and a space.

KR Bram

---

<div class="post-metadata">

**Author:** ![Bram](https://community.activepieces.com/user_avatar/community.activepieces.com/bram/32/2705_2.png) [@Bram](https://community.activepieces.com/u/Bram)\
**Post date:** [June 11, 2024, 12:26pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/16 "2024-06-11T12:26:31Z")

</div>

Hi @SCH_Hiring,

it looks like there is something wrong with you mapping, could you please double check you have mapped the correct fields?

If so, could you try to replace the mapped field with the number you are after to see if that works?

btw if you could record something that would be great.

Just trying to see I can help you further.

KR bram

---

<div class="post-metadata">

**Author:** ![JulianJay](https://community.activepieces.com/user_avatar/community.activepieces.com/julianjay/32/1140_2.png) [@JulianJay](https://community.activepieces.com/u/JulianJay)\
**Post date:** [June 11, 2024, 12:58pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/17 "2024-06-11T12:58:33Z")

</div>

Hi Bram!  
Thanks for your swift reply!  
Exactly, its the **[https://WP/wp-json/wp/v2/posts/post](https://WP/wp-json/wp/v2/posts/post)** endpoint.

The space between the coma does not seem to play a role. I tried it manually. With or without - it assigns the correct categories:

 ![image](https://community.activepieces.com/uploads/default/original/2X/e/e6bed7563eb2c740dd5ecf0f7c48a3d4a49a2392.png)

So again to sum up:  
“categories”: “{{step\_20}}” results in

 ![image](https://community.activepieces.com/uploads/default/original/2X/f/fc5c355cb778dd691348fbb689a72b5607fd3d97.png)

while using

 ![image](https://community.activepieces.com/uploads/default/original/2X/b/b734b22449fc979fe4aefc4eb95b078d97d7b7e3.png)

results in assigning 0 categories to the post:  
 ![image](https://community.activepieces.com/uploads/default/original/2X/d/dad664c49ec0326efcd59613a620c68023c76227.png)

---

<div class="post-metadata">

**Author:** ![Bram](https://community.activepieces.com/user_avatar/community.activepieces.com/bram/32/2705_2.png) [@Bram](https://community.activepieces.com/u/Bram)\
**Post date:** [June 11, 2024, 1:04pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/18 "2024-06-11T13:04:04Z")

</div>

Hi @JulianJay

As ealier suggested, remove the block hooks

Just between apostrophes: “19, 21” and not [19, 21]

This should work, let me know the outcome

KR bram

---

<div class="post-metadata">

**Author:** ![JulianJay](https://community.activepieces.com/user_avatar/community.activepieces.com/julianjay/32/1140_2.png) [@JulianJay](https://community.activepieces.com/u/JulianJay)\
**Post date:** [June 11, 2024, 1:08pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/19 "2024-06-11T13:08:08Z")

</div>

Ah okay thanks!  
Now I got it.  
Using it as such works!  
 ![image](https://community.activepieces.com/uploads/default/original/2X/2/25b243ec18e742d9dd406c7e8f92481b1bc98d20.png)

Thanks- an easy fix.

---

<div class="post-metadata">

**Author:** ![SCH\_Hiring](https://community.activepieces.com/user_avatar/community.activepieces.com/sch_hiring/32/594_2.png) [@SCH\_Hiring](https://community.activepieces.com/u/SCH_Hiring)\
**Post date:** [June 11, 2024, 4:59pm UTC](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366/20 "2024-06-11T16:59:26Z")

</div>

Thanks for trying to help.

It did not work for me, so I used node.js in a code piece instead.

[Next page](https://community.activepieces.com/t/sending-integer-through-json-in-http-request-piece/4366.md?page=2)
