View Categories

Difference Between API and UI Date-Based Filtering – LastModifiedOn vs ModifiedOn

2 min read

Problem Statement: #

Customers observed a mismatch between leads fetched via API and leads displayed in the UI when filtering by modified date.

Specifically:

  • Leads retrieved using the Get Lead By Date Range (Leads.RecentlyModified) API did not exactly match the leads shown in the UI when applying the Modified Date filter or Advanced Search.

  • Some leads appeared in the API response but were not visible in the UI results for the same date range.

This created confusion regarding data consistency between API and UI results.

Root Cause: #

The difference occurs because the API and UI use different date fields for filtering:

  1. API – Leads.RecentlyModified

    • Works based on the LastModifiedOn field.

    • LastModifiedOn represents the most recent update made to a lead across all backend tables.

    • If any related field (even outside the main lead table) is updated, the LastModifiedOn value is updated.

  2. UI Filters (ModifiedOn / Advanced Search)

    • Work based on the ModifiedOn field.

    • ModifiedOn tracks updates only for fields stored in the main lead table.

    • If updates are made to non-main table fields, ModifiedOn does not change.

      Impact: #

      Due to this functional difference:

      • Leads may appear in the API response (based on LastModifiedOn)

      • But may not appear in the UI filter results (based on ModifiedOn)

      This behavior is expected and system-driven.

      To retrieve lead records that exactly match what is visible in the UI:

      • Use the Retrieve Leads by Search Parameter API instead of the RecentlyModified API.

        Payload of this API for reference:

        {

               “SearchParameters”: {

                   “DefinitionType”1,

                   “AdvancedSearchTextNew”“{“GrpConOp”:”And”,”Conditions”:[{“Type”:”Lead”,”ConOp”:”or”,”RowCondition”:[{“SubConOp”:”And”,”LSO”:”ModifiedOn”,”LSO_Type”:”DateTime”,”Operator”:”between”,”RSO”:”2025-07-29 TO 2025-07-29″,”RSO_IsMailMerged”:false},{“RSO”:””},{“RSO”:””}]}],”QueryTimeZone”:”India Standard Time”}”,

                   “LeadOnlyConditions”“{“GrpConOp”:”And”,”Conditions”:[]}”,

                   “RetrieveColumns”“ProspectID,FirstName,LastName,EmailAddress”

               },

               “Columns”: {

                   “Include_CSV”“ProspectID,FirstName,LastName,EmailAddress”

               },

               “Sorting”: {

                   “ColumnName”“ModifiedOn”,

                   “Direction”1

               },

               “Paging”: {

                   “PageIndex”1,

                   “PageSize”100

               }

           }

Scroll to Top