Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
SJeshwani1618330394
Contributor
Contributor

How to extract values from geojson file?

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

Labels (2)
5 Replies
Anonymous
Not applicable

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

SJeshwani1618330394
Contributor
Contributor
Author

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

Anonymous
Not applicable

please show us an example of date string and the expression you are using for the conversion.

 

 

SJeshwani1618330394
Contributor
Contributor
Author

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.

 

0695b00000JMrPyAAL.pngI 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

 

XJ_1630
Contributor III
Contributor III

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)