Four Stars

Error when extracting fields from json file - unbound prefix

Hi,

I'm trying to extract the fields "name", "type", "value" and "showvalues" from the json code below:

"categories": [{
	"id": "ident1",
	"properties": {
		"SP:name": {
			"name": "Name",
			"type": "String",
			"value": "value1",
			"showvalues": "showvalue1"
		}
	}]

by using the component tExtractJSONFields. My basic component settings look as follows:

 

basic_settings_picture.png

When I run the job, I get the error message "Unbound prefix: SP". It works when deleting the "SP:" in the JSON file, but tha is not a permanent solution.

Any ideas how to solve this? Thanks in advance!

 

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: Error when extracting fields from json file - unbound prefix

Hi
Before tExtractJsonfield, you can remove "SP:" using java code on tjavaRow. eg:
...tJavaRow--main--tExtractJsonfield....
on tjavaRow:
output_row.columnName=input_row.columnName.replaceAll("SP:","");

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
2 REPLIES
Community Manager

Re: Error when extracting fields from json file - unbound prefix

Hi
Before tExtractJsonfield, you can remove "SP:" using java code on tjavaRow. eg:
...tJavaRow--main--tExtractJsonfield....
on tjavaRow:
output_row.columnName=input_row.columnName.replaceAll("SP:","");

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Four Stars

Re: Error when extracting fields from json file - unbound prefix

Hi Shong,

 

thanks for your answer, it worked perfectly.

 

Regards

weeze