Skip to Content
Technical Articles
Author's profile photo Chandranath Ghosh

Differnce between fromDate and toDate in CPI

Introduction:

In this blog, you understand the difference between fromDate and toDate and how it’s worked.

OData API supports two keywords as a filter parameter.

  1. fromDate 
  2. toDate

Use the filter parameter fromDate to return historic as well as future dated records.

fromDate gets the data basis on endDate and toDate gets the data basis on StartDate.

Example:-

For example- the employee has 2 home address records in SuccessFactors, 1st  address valid till 31/08/2022, and the second address valid from 01/09/2022 to 31/12/9999. 

when we get the data using fromDate=9999-12-31, then the 2nd address shows.

Because fromDate always gets the data basis on endDate

And when we get the data using toDate=9999-12-31, then both address shows. 

Because toDate always gets the data basis on StartDate. 

Ex 2:-

For example, 1 employee is hired on 01/05/2022 and the employee startDate is 22/7/2022. this employee endDate on 29/07/2022 set the data. If we need terminated reason and employee terminated information (end date information), we have to use fromDate=9999-12-31.

Because fromDate search the data basis on endDate.

using%20fromDate%20filter%20try%20to%20get%20future%20terminated%20employee%20data%20and%20termination%20information

using the fromDate filter try to get future terminated employee data and termination information

After%20using%20fromDate%20filter%20we%20get%20the%20future%20terminated%20employee%20details

After using the fromDate filter we get the future terminated employee details

if we use the toDate parameter not get any termination details because employee startDate>currentDate and toDate search the data basis of StartDate.

Ex 3:- 

we also use this filter parameter for historical data.

for example, we have to get job changes information SF to middleware. 2010 to the current date and get all changes information then we use fromDate=2010-01-01 and toDate=currentDate

  • if we need the last job change information then we have to use fromDate=currentDate

Conclusion:

Here you saw the basic difference between fromDate and toDate.Basically, using fromDate we can get the latest data, and fromDate searches the data basis on endDate. where toDate search the data basis on startDate.

Please let me know, if you have any questions regarding this blog by commenting or if you want to give any feedback on this post.

If my post helped you anyway then please don’t forget to like the post and also press the follow button for more updates.

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo satish babu
      satish babu

      nice explantion

      Chandranadh

      Author's profile photo Chandranath Ghosh
      Chandranath Ghosh
      Blog Post Author

      Thank you Satish babu