UPCASE in tMap Error : Type mismatch: cannot convert from String to Boolean in tMap

Four Stars

UPCASE in tMap Error : Type mismatch: cannot convert from String to Boolean in tMap

Hello everyone,

 

I'm trying to use StringHandling.UPCASE() in tmap to convert the first letter in a sentence to Capital. So here is what I tried

 

First expression

StringHandling.UPCASE(Var.var1)

var1 is..... StringHandling.LEFT(row1.Design,1)

 

Second expression

StringHandling.UPCASE(StringHandling.LEFT(row1.Design,1))

 

Third expression

I even tried to upper case all the sentence (to check if it works) using StringHandling.UPCASE(row1.Design)

 

But in all three cases I get the same error again and again, am not sure what is wrong in my syntex...

 

Error: Type mismatch: cannot convert from String to Boolean in tMap

 

Thank you for your help,

srashad

Eleven Stars

Re: UPCASE in tMap Error : Type mismatch: cannot convert from String to Boolean in tMap

Do you have any Column as Boolean in Variable expression or Output Expression  window.

 

Check there if you are using String instead of Boolean.

 

Note that : "true"(String) is not equal to true (Boolean)

 

Also you could use simple expression like

 

row1.columnname == null ? "" : row1.columnname.substring(0, 1).toUpperCase() + row1.columnname.substring(1)
Regards
Abhishek KUMAR

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 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog