cancel
Showing results for 
Search instead for 
Did you mean: 

Date Function

Former Member
0 Kudos

hi,

I have a date function, which I am transforming from one format to another format. But when I dont send any date, its throwing an error. How can I create the transform function only when I have some data in it?

Thanks,

Sunita.

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member581827
Participant
0 Kudos

Hi Sunitha,

You can try some thing like this

DATE -


> Transform

Date->Length>

Equals->NOt--->IF Date

else

[0] constant

Regards,

Chandra.

0 Kudos

Use if then else. If your date is equal to [] null then null (no transform).

else transform your date and send it.

Hope this works for you as it did for me.

Former Member
0 Kudos

HI,

Use the function, if then else

use if function and check the value of the input field by using string equals funtion and compare with the constant "null", then map it to if condition, in the then field map a constant with null and if the else field map the input field.

Regards,

Nithiyanandam

former_member200962
Active Contributor
0 Kudos

folks please check the Date of posting of the Question before replying

Former Member
0 Kudos

Sunita,

What about <b>createIf()</b>.

-Naveen.

Former Member
0 Kudos

HI KrishnaMoorthy,

I tried that, but its not working, can u please try that for me and tell me on how to do that?.

I tried with createIf, exists with if, and if without else.

Please suggest me.

Thanks,

Sunita.

moorthy
Active Contributor
0 Kudos

Hi,

Source field-> Exists function->If then ->DateFormat Function->Target Field

Else Constant->DateFormatFunction->Target Field.

Are you using standard Dateformat function or UserDefined function. If userdefined function then try source is empty then do nothing inside the java function. For this also above mapping is required..

Thanks,

Moorthy

Former Member
0 Kudos

Hi Sunitha,

try a funtion to accept a system date when you don't want to send a date.

Regd's

Hari

moorthy
Active Contributor
0 Kudos

HI Sunita,

Use Exists node funstion before transforming the dates with If-Else Logic in the Message Mapping. If it exists then transform it else don;t do anything..

Hope this helps,

REgards,

Moorthy