Extract data from text string

I have an API that returns to me a data in this text format: 31/05/2021
How can I convert it in a data type?

I tried with toolbox using new Date(yyyy,mm,dd) extression, but I can’t find a way to extract the single date components from the string.

Or maybe there is a better solution?

Thank you so much!

Are you getting this data via the API Connector? If yes, the Connector has always been rather good at sussing out which type of data that is. If it doesn’t, just tell it that this field should be a date.

1 Like

Thank you!

This is righ, but If I set date on the connector i got the date but not in my format (european) dd/mm/yyyy.
I mean:
If I have 03/11/2021 the right date is 3 november 2021, but the connector read 11 march 2021.

There is a solution for that?

Oh damn… I used to have an issue with one of my APIs. I got “around it” by nagging the provider to implement something more ISO 8601 compliant.

To get around it I had some ape-handed :find and replace (with regex). The Internet must have a good regex recipe to fix it. Otherwise, I would look around the Internet for an API that can fix the date format for you.

Wait, when you initialize the endpoint in the API Connector, what data did it return? If it returned something like 02/02/2020 is not helpful. But if it returns 31/05/2020 I’m guessing the API Connector will recognize that as May 31, no?

This topic was automatically closed after 70 days. New replies are no longer allowed.