# Datetime array from API not saved in database

**URL:** <https://forum.bubble.io/t/datetime-array-from-api-not-saved-in-database/8068>\
**Category:** APIs\
**Created:** [November 21, 2016, 3:52pm UTC](https://forum.bubble.io/t/datetime-array-from-api-not-saved-in-database/8068 "2016-11-21T15:52:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas.schijf](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/thomas.schijf/32/7387_2.png) [@thomas.schijf](https://forum.bubble.io/u/thomas.schijf)\
**Post date:** [November 21, 2016, 3:52pm UTC](https://forum.bubble.io/t/datetime-array-from-api-not-saved-in-database/8068/1 "2016-11-21T15:52:31Z")

</div>

I’m trying to store data from an API call, it perfectly stores numbered and texts fields, but it does not save a datetime array I provide:

[https://myapp.bubbleapps.io/version-test/api/1.0/wf/get\_data](https://myapp.bubbleapps.io/version-test/api/1.0/wf/get_data)

Test from Postman

 ![](https://us1.discourse-cdn.com/bubble/original/2X/5/5d7cf04507010a734cc0e9ea72638148a297a7e4.png)

Result in Bubble database

 ![](https://us1.discourse-cdn.com/bubble/original/2X/d/d986b1978cb7598fc1e5015d21160f5723de11f7.png)

Set-up API WF (endpoint)

 ![](https://us1.discourse-cdn.com/bubble/original/2X/1/186a8eab77df927d02aea75c291446c71c10c99f.png)

Set-up API WF (action)

 ![](https://us1.discourse-cdn.com/bubble/original/2X/6/6ad51396c86d406cf081c1dafa97909c6d73c844.png)

Who can help me out?

---

<div class="post-metadata">

**Author:** ![john3](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/john3/32/5625_2.png) [@john3](https://forum.bubble.io/u/john3)\
**Post date:** [November 21, 2016, 4:09pm UTC](https://forum.bubble.io/t/datetime-array-from-api-not-saved-in-database/8068/2 "2016-11-21T16:09:27Z")

</div>

Do you think it’s the quotation marks causing the problem?

How about if you try to save it as text first to see if it even loads ok.

Then if that’s the issue I would use text as an initial load field and create a secondary field that does a find replace on the quotation marks and then adds to the real data field of type date.

---

<div class="post-metadata">

**Author:** ![thomas.schijf](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/thomas.schijf/32/7387_2.png) [@thomas.schijf](https://forum.bubble.io/u/thomas.schijf)\
**Post date:** [November 21, 2016, 5:01pm UTC](https://forum.bubble.io/t/datetime-array-from-api-not-saved-in-database/8068/3 "2016-11-21T17:01:08Z")

</div>

Thanks @john3 I’ve tried to load it as text, this works properly since the other parameters are stored as text/number as well. I will use this solution as temporary, but it is not preferred. Removing the quotation marks gives me the following error in Postman:

```
{
  "statusCode": 400,
  "body": "{\n \"status\": \"INVALID_DATA\",\n \"message\": \"Issue with data for workflow get_data: [02/13/2016, 02/13/2016, 02/13/2016] cannot be parsed as a JSON\"\n}"
}
```

---

<div class="post-metadata">

**Author:** ![john3](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/john3/32/5625_2.png) [@john3](https://forum.bubble.io/u/john3)\
**Post date:** [November 21, 2016, 5:06pm UTC](https://forum.bubble.io/t/datetime-array-from-api-not-saved-in-database/8068/4 "2016-11-21T17:06:05Z")

</div>

Oh good - at least you know it works then!

To clarify - I wouldn’t remove the quotation marks before pulling it down to bubble.

Keep it that way and put it in a extra field in your database that’s designated for text. Then in your original date/time field do a search for that text field and strip out the quotation marks with a find replace and see if bubble will take the dates and store them in the correct format.

So in the end you’ll have 2 fields a temporary text field and the date/time field.

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [November 21, 2016, 5:06pm UTC](https://forum.bubble.io/t/datetime-array-from-api-not-saved-in-database/8068/5 "2016-11-21T17:06:09Z")

</div>

There may be a bug there, can you file a bug report?

---

<div class="post-metadata">

**Author:** ![thomas.schijf](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/thomas.schijf/32/7387_2.png) [@thomas.schijf](https://forum.bubble.io/u/thomas.schijf)\
**Post date:** [November 21, 2016, 9:21pm UTC](https://forum.bubble.io/t/datetime-array-from-api-not-saved-in-database/8068/6 "2016-11-21T21:21:17Z")

</div>

will do
