Has anyone ever successfully retrieved a DATE RANGE datatype from the API Connector? It’s unclear to me what sort of JSON structure Bubble needs to see to be able to import that object as a Date Range.
If so, could someone provide an example of the raw JSON data that can properly be interpreted as a single date range object?
As an example of what does not work: A range constructed by moment-range will come across as JSON like this:
I do know how to construct a Bubble-style date range in JavaScript using Toolbox (as @mishav explained to me, it is like this):
However, I’ve not been able to construct the correct JSON that Bubble would expect for one of its own “date range” objects. All of my various attempts do not yield a correct interpretation by the API Connector.
That is, basically a 2 element list of dates, right? But if you send this from an API and then tell Bubble that this is a date range, it does not interpret it that way.
Basically, there’s no way to “guess” the right answer here. Just wondering if anyone’s ever stumbled across it…
For the API result parser, it would be too big an assumption to create a date range type automatically, as next time it runs it could be a list of three dates instead of two.
As for the manually setting of the date range type, it complicates the UI because it would be condensing a structure containing a type, into a single type. So it will be interesting to see how Bubble achieves that, if they decide there is a need for it.
Point is that API Connector offers this as an option… but I can’t figure out if it ACTUALLY
can be selected successfully. Everything results in a malformed range inside of Bubble. Grumble.
Yeah, seems to be an undefined sort of condition. (i.e., a feature that is not finished.)
Just to be clear, the API I’m talking about is my own. I wrote it and can edit it. I KNOW the thing it’s sending is meant to represent a date range. I just can’t deliver it in any JSON form that Bubble seems to understand. (I’ll file a bug report/question about this and let ya know the answer!)
Hello @keith, any update on this? I’d be interested in knowing how Bubble manages date range data types.
I’m actually trying to send a date range via api call (actually Bubble App Connector), and I can’t figure out how to send an array of date range. The end side is a Bubble app, whose API expects an array of date range.