Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
nmodi
Creator

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, 

 

 

 

0683p000009M6vF.png

 

Labels (3)
2 Replies
Anonymous
Not applicable

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

nmodi
Creator
Author

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

0683p000009M6gA.png

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