Skip to main content

I'm trying to read a .json file into a single feature attribute.

So far all my attempts to read the json has led to it being flattened, with all json 'keys' showing up as an attribute. The reason I want to have it in one attribute is that the jsons in question are service definition for ArcGIS Online content. Essentially it gets converted into a python dictionary using json.loads(feature.getAttribute(...)).

 

One workaround I've thought of is just changing the extension of the json to .txt and reading that instead. However, I would prefer to do it a neater way, if there is one.

 

Any suggestions?

You can use the Text File reader and set it to read the whole file in at once (rather than line by line). It's not necessary to change the file extension for this to work.


You can use the Text File reader and set it to read the whole file in at once (rather than line by line). It's not necessary to change the file extension for this to work.

Hi David, thanks for your suggestion. I'll use this approach.

 


Reply