Error when extracting fields from json file - unbound prefix

Highlighted
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!

 


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

All 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

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download