I need to compare two dates one is getting through profile and one is coming through property(both as string). I need to compare these two dates in business rule so I can add another rule with this condition.
Can you share a more details example. As you mention that date is as "String". You can compare two dates in a business rule if both of your dates are in same format.
Hi Ashish Patel
I have stored one date in process property and another date string is coming in SF connector response profile. When I compare these two dates logs display comparison as string comparison and expected result is wrong. I think for comparing dates I need a function that parse those two dates and then based on the comparison result I can move fwd.
What I'm Doing now-
I'm comparing these dates in map(custom scripting) and based on output value I can move fwd with a decision shape.
I still want to implement it in business rule because my solution used two shapes which can be further reduced.
What format are both of your dates in?
Nancy Kenney : its in "yyyyMMdd HHmmss.SSS" format but both are string I think.
Best practice is to update all your profiles (XML, Json, database, flatfile) regarding date/time fields. Don't use character but "date/time" as shown below. The format can of course differ from endpoint to endpoint. This way, Boomi will take care of date transformations and.....you can use the internal Boomi date format in comparisons, to sort data etc. This format looks like this: yyyyMMdd HHmmss.SSS
Btw: you can also use a map function with scripting and call it from a Business rule shape. Very powerful feature
Here's an example. Input XML:
<EVENTS> <PAR_START_DATE>2017-03-08T13:23:31.000+01:00</PAR_START_DATE> <PAR_END_DATE>2017-03-10T13:23:31.000+01:00</PAR_END_DATE></EVENTS>
Check the log below and you'll see Boomi uses it's internal date format
Have a look at this documentation which is specific to Decision shape but I assume this should be working for Business rules as well.
Decision shape failing to compare MM/dd/yyyy format date time variables
Key is to change the date mask of the date value that you get from properties to the same format as SF date mask.
FYI SF date format is: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
And agree with Srinivas on matching the date format.
Retrieving data ...