Need to convert resultset fieldnames to caps.

Hi All,

we ran into a scenario where we’re not able to control the fieldnames coming from the target. Like for example, UserName. Sometimes when we get it will be username ( all small letters ) and UserName ( U and N are caps ). This is making life difficult when mapping.

So, the solution they suggested is to convert all the fieldnames to CAPS and then do the mapping. ( without converting the data for those fieldnames ).

Any ideas? Please let me know.

Is the target you are mentioning a database? If yes, are you using JDBC Adapters? If not, why is target giving the field names in different cases every time? Is it a dynamic behavior on the target’s side?

Its a LDAP server and we do not have any control over it as there are many systems which load the data. They’re still looking into this but due to the timelines, we need to test this asap so trying this thing for time being.

Try the code sample attached. Hope it helps
SamplePackage.zip (6.4 KB)

1 Like

Thanks Prasad! Will try and let you know. Thanks much!!

Thanks Prasad, It is working but only for single document. If we pass or map a document list, it is not working. I’m looking for something where I need to pass a document list and the output is document list.

Hi Kumar,

I have modified and attached a more generic service that converts the fields in even deeply nested documents to uppercase. It takes array as input and gives array as output. In case you want to use it for single documents then just map the single document to input array directly and taken the 0th index of output as result.

Regards,
SamplePackage.zip (7.46 KB)

1 Like

Great, Thanks so much Prasad! It really worked. Thanks again for all your help and time!