cancel
Showing results for 
Search instead for 
Did you mean: 

How to write UDF?

Former Member
0 Kudos

Hi all,

I want to write the UDF for this requirement.....if i dont get data from source side then i have to pass default value, if i get the value from source side not need to send default value.............how to write this UDF

regards,

kumar

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

And need to keep min occurence of the target field as 1 and use mapwithdefault function as Raj said.

justin_santhanam
Active Contributor
0 Kudos

Phani,

You don't need UDF for this.

Use <b>MapwithDefault</b> option. If the node is present then the value will take from the node, if its not there then it will default the value to the target.

-Raj.

sbhutani1
Contributor
0 Kudos

Hi Phani,

well this thing you can do without using UDF, while doing source and target field mapping you can use standard function If without else you can check the value of the source field if it is blank(use a constant with space to compare the value of source field) then you can use your another value otherwise you can assign your original value.

well i think if you can do this in graphical mapping then there is no need for writing UDF for this. Always write UDF when the condition is very much complex and which cant be done using any other way.

Regards

Sumit Bhutani