Five Stars

Add 0 at the first of No. telephone

I want a expression builder of tMap to test the No of telephone if it < 10 digit add 0+No telephone

StringHandling.LEN("ToMap.telephone") <10 ? "0"+ToMap.telephone

Note the input of telephone and output is String in tMap

Thank you

 

 

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Seven Stars

Re: Add 0 at the first of No. telephone

no question in post :-)

 

but generally

 

ToMap.telephone!=null&&StringHandling.LEN("ToMap.telephone")<10? 
"0"+ToMap.telephone
:ToMap.telephone

must work 

-----------
3 REPLIES
Seven Stars

Re: Add 0 at the first of No. telephone

no question in post :-)

 

but generally

 

ToMap.telephone!=null&&StringHandling.LEN("ToMap.telephone")<10? 
"0"+ToMap.telephone
:ToMap.telephone

must work 

-----------
Five Stars

Re: Add 0 at the first of No. telephone

thank you
I tested it always no zero in the first of the no. of telephone in database Sql server and also in tLogRow
Seven Stars

Re: Add 0 at the first of No. telephone

it could be if You use Not String for destination

 

could You attach You settings - column definition in tMap and output table?

-----------