cancel
Showing results for 
Search instead for 
Did you mean: 

Concat String with Null Value

Former Member
0 Kudos

Hello,

I would like to concat two fields, however there may be cases when the second field is not present, i.e. null. In this case the result of the concat is null too!

for example concat string "text" with a non existing field is null. I would expect that in this case the value is just text.

Is there a workaround? Of course I could add some more checks etc. but the graphical field mapping is already complicated enough and I do not want to add too many additional steps just for this purpose.

Thank you for your help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi florian,

Use "mapwithdefault" function for the element which is optional. If It comes "null" the function is going to replace by the default value You could configure.

Regards

Ivan

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Florian,

As Jose suggested you can use mapwithdefault and in mapwithdefault use a space and if you get null then it will send space to your output and in the end just put trim. It should give you the expected output.

field1 --> concat

field2 -> mapwithdefault(space)> result of concat --> trim --> targetfield

Regards,

---Satish

Former Member
0 Kudos

>>Is there a workaround?

Nothing that i can think of,its best to add If-Else checks to check the existence of Node

Thanks

Aamir