# How to specify variable type while starting a process

**URL:** <https://forum.flowable.org/t/how-to-specify-variable-type-while-starting-a-process/788>\
**Category:** Flowable Engine\
**Created:** [July 28, 2017, 8:05am UTC](https://forum.flowable.org/t/how-to-specify-variable-type-while-starting-a-process/788 "2017-07-28T08:05:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kernelogic](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/kernelogic/32/49_2.png) [@kernelogic](https://forum.flowable.org/u/kernelogic)\
**Post date:** [July 28, 2017, 8:05am UTC](https://forum.flowable.org/t/how-to-specify-variable-type-while-starting-a-process/788/1 "2017-07-28T08:05:17Z")

</div>

How to specify variable type while starting a process via REST? For example if I do this, the variable is still “text” type:

```
{
   "processDefinitionKey":"oneTaskProcess",
   "businessKey":"myBusinessKey",
   "returnVariables":false,
   "tenantId": "tenant1",
   "variables": [
      {
        "name":"total",
        "type":"double",
        "value":1234.56,
      }
   ]
}
```

---

<div class="post-metadata">

**Author:** ![yvo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/yvo/32/2231_2.png) [@yvo](https://forum.flowable.org/u/yvo)\
**Post date:** [July 28, 2017, 8:08am UTC](https://forum.flowable.org/t/how-to-specify-variable-type-while-starting-a-process/788/2 "2017-07-28T08:08:46Z")

</div>

Hi.

Is this the exact json payload?  
This isn’t valid; “value”:1234.56,

Regards,

Yvo

---

<div class="post-metadata">

**Author:** ![kernelogic](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/kernelogic/32/49_2.png) [@kernelogic](https://forum.flowable.org/u/kernelogic)\
**Post date:** [July 28, 2017, 8:13am UTC](https://forum.flowable.org/t/how-to-specify-variable-type-while-starting-a-process/788/3 "2017-07-28T08:13:14Z")

</div>

This is the real part. How is it not valid?

```
name:"yujihejia",
type:"double",
value:54810810.76
```

---

<div class="post-metadata">

**Author:** ![yvo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/yvo/32/2231_2.png) [@yvo](https://forum.flowable.org/u/yvo)\
**Post date:** [July 28, 2017, 8:32am UTC](https://forum.flowable.org/t/how-to-specify-variable-type-while-starting-a-process/788/4 "2017-07-28T08:32:03Z")

</div>

Your first json payload was formatted wrong. (The last comma)

When I do a start process instance request like this;

```
{
   "processDefinitionKey": "testvar1",
   "variables": [
      {
        "name": "myVar",
        "value": 15.32,
        "type": "double"
      }
   ]
}

```

The process instance get started with a double variable on the context.

Regards,

Yvo

---

<div class="post-metadata">

**Author:** ![kernelogic](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/kernelogic/32/49_2.png) [@kernelogic](https://forum.flowable.org/u/kernelogic)\
**Post date:** [July 28, 2017, 8:50am UTC](https://forum.flowable.org/t/how-to-specify-variable-type-while-starting-a-process/788/5 "2017-07-28T08:50:40Z")

</div>

Thank you. You are right. It’s my code mistake.
