Alternate or multiple Field name mapping in JSON

Highlighted
Seven Stars

Alternate or multiple Field name mapping in JSON

so I m trying to extract JSON data submitted via API calls & it is working fine, 

 

what I want to do it little bit more flexible & parse data even field names are little different to up-to certain extent,

 

Such as

  • 'Name' fieldname - it should even accept & map field names such as name, NAME etc..to Name field data
  • 'Address' fieldname - it should even accept & map field names such as address, ADDRESS, address1, Address1 etc..to Address field data
  • 'Zip' fieldname - it should even accept & map field names such as ZIP, POSTALCODE, zip, postalcode etc..to Zip field data

 

and I know field names are case sensitive here that means even if client pass data as 'name' or 'NAME' instead of 'Name' field name, data doesn't get mapped.

 

Basically Is there a way to map multiple field names to one field or specify alternate field names in JSON mapping?

 

 

Here is the current field mapping, 

 

 

 

tExtarctJSONFields.PNG

 

Employee

Re: Alternate or multiple Field name mapping in JSON

Hi,

 

    Since the component will work on schema based approach, you will not be able to chnage field names on the fly. At the same time, you can try to replace the matching values  for field names before sending the data for parsing.

 

    For this case, you will have to do a search and replace for the values using regular expressions (Hints:- refer java regular expressions in java forums) for the entire input JSON string.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

Seven Stars

Re: Alternate or multiple Field name mapping in JSON

Thanks Nikhil, I am referring to this (highlighted below), if we can use this by by means & mention field alternate field names

jsonpath_alternatenames.PNG

ref - http://umashanthan.blogspot.com/2015/11/json-path-expression-for.html

 

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download