# Create Custom Field List Box using API

**URL:** <https://integration.keap.com/t/create-custom-field-list-box-using-api/78278>\
**Category:** API Q&A\
**Tags:** custom-fields, api\
**Created:** [July 4, 2020, 3:18pm UTC](https://integration.keap.com/t/create-custom-field-list-box-using-api/78278 "2020-07-04T15:18:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garik\_Tate](https://avatars.discourse-cdn.com/v4/letter/g/43a26b/32.png) [@Garik\_Tate](https://integration.keap.com/u/Garik_Tate)\
**Post date:** [July 4, 2020, 3:18pm UTC](https://integration.keap.com/t/create-custom-field-list-box-using-api/78278/1 "2020-07-04T15:18:57Z")

</div>

Our app dynamically created a Drilldown (Select) Custom Field successfully before. Now, we need to dynamically create a List Box. But I can’t seem to figure out the correct “DataType” value for it.

**WHAT WE DID:**  
We’re about to send these values to **DataService.addCustomField**

```
array:4 [▼
  "customFieldType" => "Contact"
  "displayName" => "XXXXX"
  "dataType" => "Option List" // <-- what we need to figure out
  "headerId" => 47
]

```

We then get an error that says:

> [InvalidParameter]The data type “Option List” is an invalid type

**WHAT WE TRIED:**

1. We tried to look for something in **[this guide](https://developer.infusionsoft.com/docs/xml-rpc/#data-create-a-custom-field)**. However, it only mentions Text, Select (Used for Dropdown), TextArea. It didn’t say anything about “List Box”.

2. We also checked **[here](https://help.infusionsoft.com/help/choose-custom-field-types)** but it also doesn’t say anything about what “dataType” to use when creating “List Box” thru the API.

3. We tried doing all these below as a possible “dataType” values to create List Box. But the same “invalid type” error still shows.

> List Box  
> ListBox  
> List  
> Box  
> Options  
> Option  
> Option List  
> OptionList  
> Options List  
> Option Lists  
> Options Lists  
> “17” ← sent as a string, because ListBox DataType integer is 17.  
> 17 ← sent as an integer. Returns “no method matching args” error instead.

1. Lastly, we tried creating a record directly at DataFormField group by executing

`request('DataService.add', 'DataFormField', $values)`

With values:

```
$values = [
	"Label" => "XXXXX",
	"DataType" => 17,
	"ListRows" => 0,
	"FormId" => -1,
	"GroupId" => 47,
	"Name" => "XXXXX"
];

```

Although no error occurred, but the return value is **FALSE**. No new custom field was created when checking Infusionsoft too.

**QUESTION**  
Is it possible to create a custom field List Box? and if so, what “DataType” value do we need for it?  
Or maybe we missed something from the steps we did above?

---

<div class="post-metadata">

**Author:** ![John\_Borelli](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/john_borelli/32/11880_2.png) [@John\_Borelli](https://integration.keap.com/u/John_Borelli)\
**Post date:** [July 5, 2020, 11:12pm UTC](https://integration.keap.com/t/create-custom-field-list-box-using-api/78278/2 "2020-07-05T23:12:04Z")

</div>

Option list is not a data type and the data type field is an enumeration of data types determined in the table documentation. For the drill down it must be set to 23

 ![image](https://us1.discourse-cdn.com/flex019/uploads/infusionsoft1/original/2X/7/74555b4c9b88d2e1464e42adadcde6aac11b7456.png)

---

<div class="post-metadata">

**Author:** ![Garik\_Tate](https://avatars.discourse-cdn.com/v4/letter/g/43a26b/32.png) [@Garik\_Tate](https://integration.keap.com/u/Garik_Tate)\
**Post date:** [July 6, 2020, 2:08am UTC](https://integration.keap.com/t/create-custom-field-list-box-using-api/78278/3 "2020-07-06T02:08:49Z")

</div>

@John_Borelli oh sorry, thanks for the clarification. But what I mean is we need to create a List Box - where a user can select multiple items from a list:

![2020-07-06_09-51-21](https://us1.discourse-cdn.com/flex019/uploads/infusionsoft1/original/2X/4/49da451bf831f142ca5988f0da5f8ea77c9b306d.png)

And we believe its ID is **17** :

 ![2020-07-06_09-57-05](https://us1.discourse-cdn.com/flex019/uploads/infusionsoft1/original/2X/f/f4fba6685155fd5a6e56dff0dba5eee638d326da.png)

So we tried sending **17** as dataType to **DataService.addCustomField** like so:

```
array:4 [▼
  "customFieldType" => "Contact"
  "displayName" => "XXXXX"
  "dataType" => "17" // <-- what we need to figure out
  "headerId" => 47
]

```

But we still get this error:

![2020-07-06_10-02-27](https://us1.discourse-cdn.com/flex019/uploads/infusionsoft1/original/2X/1/1cdfa9797bbd2489ded1f8c30988be7525bb4fd9.png)

---

<div class="post-metadata">

**Author:** ![John\_Borelli](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/john_borelli/32/11880_2.png) [@John\_Borelli](https://integration.keap.com/u/John_Borelli)\
**Post date:** [July 6, 2020, 1:37pm UTC](https://integration.keap.com/t/create-custom-field-list-box-using-api/78278/4 "2020-07-06T13:37:03Z")

</div>

Ok, so the format you’re showing doesn’t match either the xml-rpc or rest so which are you using. Let’s start there and work forward 😉

---

<div class="post-metadata">

**Author:** ![Garik\_Tate](https://avatars.discourse-cdn.com/v4/letter/g/43a26b/32.png) [@Garik\_Tate](https://integration.keap.com/u/Garik_Tate)\
**Post date:** [July 7, 2020, 1:07am UTC](https://integration.keap.com/t/create-custom-field-list-box-using-api/78278/5 "2020-07-07T01:07:02Z")

</div>

Oh okay. With regards to the format, we nailed it because we were able to create these three fields below **[using the xml-rpc guide](https://developer.infusionsoft.com/docs/xml-rpc/#data-create-a-custom-field)**.

What we don’t know is the **“etc.”** part. We’re trying to figure out what value to use for ListBox. And we can’t seem to find any documentation for it.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/infusionsoft1/original/2X/a/a3e0afd024958d5df6c78d65e8ac09de721b1227.png)

---

<div class="post-metadata">

**Author:** ![Garik\_Tate](https://avatars.discourse-cdn.com/v4/letter/g/43a26b/32.png) [@Garik\_Tate](https://integration.keap.com/u/Garik_Tate)\
**Post date:** [July 11, 2020, 12:54am UTC](https://integration.keap.com/t/create-custom-field-list-box-using-api/78278/6 "2020-07-11T00:54:45Z")

</div>

Updating this post for future reference.  
Just sent a dev ticket, and they advised to use “MultiSelect”. It works now!

```
array:4 [▼
  "customFieldType" => "Contact"
  "displayName" => "XXXXX"
  "dataType" => "MultiSelect" // <-- this works
  "headerId" => 47
]

```

---

<div class="post-metadata">

**Author:** ![Edoardo\_Guzzi1](https://avatars.discourse-cdn.com/v4/letter/e/b77776/32.png) [@Edoardo\_Guzzi1](https://integration.keap.com/u/Edoardo_Guzzi1)\
**Post date:** [May 22, 2024, 7:05pm UTC](https://integration.keap.com/t/create-custom-field-list-box-using-api/78278/7 "2024-05-22T19:05:48Z")

</div>

I have the same question but with Whole Number and Decimal Number, cause they provide the table but they aren’t the right dataType for creare custom field via xml-rpc

---

<div class="post-metadata">

**Author:** ![Edoardo\_Guzzi1](https://avatars.discourse-cdn.com/v4/letter/e/b77776/32.png) [@Edoardo\_Guzzi1](https://integration.keap.com/u/Edoardo_Guzzi1)\
**Post date:** [May 22, 2024, 9:40pm UTC](https://integration.keap.com/t/create-custom-field-list-box-using-api/78278/8 "2024-05-22T21:40:08Z")

</div>

Ok after reached the support here it is the list of dataType for custom fields.

 ![Screenshot-by-Lightshot](https://us1.discourse-cdn.com/flex019/uploads/infusionsoft1/original/2X/f/fb7626ad56809908c8dca1c4c899e96b1c6ca563.png)

update: PhoneNumber is not valid. “Phone” is valid.  
WholeNumber is not valid: is Just “Number”.

Ok good luck 😅
