Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am getting a response from REST API in the form of geojson.
How to extract the values from this file?
Any suggestions?
Regards,
Sheetal
Hi
Which component do you use call the Rest API? tRest or tRestClient? if the response is a string data, then you can use tExtractJsonFields to extract values from response string.
Regards
Shong
Hi Shong,
Thank you for your reply.
I resolved the issue to extract the data from .geojson file.
My only concern is that, I am getting an output something like this:
The values are in square brackets. How to remove that?
Moreover how to convert this Date string into date format?
I used TalendDate.parseDate to convert it, I am getting an error. I guess I am not using this properly. Could you please give me any suggestions to convert the string into a Date format?
Regards,
Sheetal
please show us an example of date string and the expression you are using for the conversion.
Hi,
Sorry, the Attachment was missing in the last message.
Here is the attachment in which you can see the values are in square brackets and the date string. It is like this: ["1985-10-18T00:00:00Z"]. Moreover, where there is no value, it's showing blank. I want to have it like Null. I tried to use tConvert and selected set empty values to null but it's not working.
I used this function: TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",row3.timetsamp)
and I have set datatype as string, I tried to do it by changing the datatype as date but still it was giving me an error, cannot convert string to Date.
Regards,
Sheetal
i would understand the square brackets to mean: the data is in an Array, and not in a string
the value apears to be defined as a string (in Talend Schema)