Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
confo_talend
Contributor
Contributor

tHMap how to used the function IfThenElse

Hi, 

I want to transform json to xml and i have in the json file a string column can contain two value : SERVICE or PRODUCT.

So in the component tHMap i want to use the function IfThenElse to put un the xml file true or false :

If ColumnValue=SERVICE then True else False.

0683p000009M8DU.png

The condition don't accept to write a code, it accept just drop/paste !!!!

 

Thanks.

 

Labels (5)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Here is an example with a dummy schema that I had on my machine....

0683p000009M8ED.png

Notice I dragged the "EQUAL" method from the Functions menu. I then added my value to the first field and dragged the "CONSTANT" function to the second. I then was able to type "SERVICE" as the "CONSTANT" value. Below you can add your THEN and ELSE options.

View solution in original post

4 Replies
Anonymous
Not applicable

Here is an example with a dummy schema that I had on my machine....

0683p000009M8ED.png

Notice I dragged the "EQUAL" method from the Functions menu. I then added my value to the first field and dragged the "CONSTANT" function to the second. I then was able to type "SERVICE" as the "CONSTANT" value. Below you can add your THEN and ELSE options.

confo_talend
Contributor
Contributor
Author

i used this solution but i have always false 0683p000009MPcz.png 

i think something else it missing

Anonymous
Not applicable

You will need to check the data that is being compared. For example, what case is it, does it have spaces after the value, etc

confo_talend
Contributor
Contributor
Author

yes it's a problem of data.

Thanks.