API date filtering not working

  • 1
  • Question
  • Updated 4 months ago
  • Answered
Dear Community

We are using the Replicon Web Service to retrieve time information for users and we are looking at filtering values to only provide dates from a certain time frame.  Our test service post body looks as follows (The service we are calling is: /services/TimeOffListService1.svc/GetData):

{
"page": "1", "pagesize": "1000", "columnUris": [ "urn:replicon:time-off-list-column:approval-status", "urn:replicon:time-off-list-column:time-off", "urn:replicon:time-off-list-column:start-date", "urn:replicon:time-off-list-column:end-date", "urn:replicon:time-off-list-column:start-day-duration", "urn:replicon:time-off-list-column:end-day-duration", "urn:replicon:time-off-list-column:time-off-owner" ], "sort": [], "filterExpression": { "leftExpression": { "leftExpression": { "filterDefinitionUri": "urn:replicon:time-off-list-column:start-date" }, "operatorUri": "urn:replicon:filter-operator:in", "rightExpression": { "value":{ "dateRange": { "startDate": { "year": 2018, "month": 7, "day": 30 }, "endDate": null } } } }, "operatorUri": "urn:replicon:filter-operator:and", "rightExpression": { "leftExpression": { "filterDefinitionUri": "urn:replicon:time-off-list-filter:approval-status" }, "operatorUri": "urn:replicon:filter-operator:equal", "rightExpression": { "value":{ "uri": "urn:replicon:approval-status:approved" } } }, "value": null, "filterDefinitionUri": null } }   
The list only brings through approved time values, but the dates are not filtered.  Are we doing anything wrong?

Thank you

Gustav
Photo of Coleske, Gustav

Coleske, Gustav

  • 2 Posts
  • 1 Reply Like

Posted 4 months ago

  • 1
Photo of Aashnee Kamboj

Aashnee Kamboj, Community Moderator

  • 1627 Posts
  • 111 Reply Likes
Hi Gustav,

May we request you to try the following

{
  "page": "1",
  "pagesize": "11111",
  "columnUris": [
    "urn:replicon:time-off-list-column:approval-status",
    "urn:replicon:time-off-list-column:time-off",
    "urn:replicon:time-off-list-column:start-date",
    "urn:replicon:time-off-list-column:end-date",
    "urn:replicon:time-off-list-column:start-day-duration",
    "urn:replicon:time-off-list-column:end-day-duration",
    "urn:replicon:time-off-list-column:time-off-owner"
  ],
  "sort": [],
  "filterExpression": {
    "leftExpression": {
      "leftExpression": {
        "leftExpression": null,
        "operatorUri": null,
        "rightExpression": null,
        "value": null,
        "filterDefinitionUri": "urn:replicon:time-off-list-filter:time-off-date-range"
      },
      "operatorUri": "urn:replicon:filter-operator:in",
      "rightExpression": {
        "leftExpression": null,
        "operatorUri": null,
        "rightExpression": null,
        "value": {
          "uri": null,
          "uris": [],
          "bool": null,
          "date": null,
          "money": null,
          "number": null,
          "text": null,
          "time": null,
          "calendarDayDurationValue": null,
          "workdayDurationValue": null,
          "dateRange": {
            "startDate": {
              "year": 2018,
              "month": 7,
              "day": 1
            },
            "endDate": {
              "year": 2018,
              "month": 7,
              "day": 31
            },
            "relativeDateRangeUri": null,
            "relativeDateRangeAsOfDate": null
          },
          "dateTimeUtc": null
        },
        "filterDefinitionUri": null
      },
      "value": null,
      "filterDefinitionUri": null
    },
    "operatorUri": "urn:replicon:filter-operator:and",
    "rightExpression": {
      "leftExpression": {
        "leftExpression": null,
        "operatorUri": null,
        "rightExpression": null,
        "value": null,
        "filterDefinitionUri": "urn:replicon:time-off-list-filter:approval-status"
      },
      "operatorUri": "urn:replicon:filter-operator:equal",
      "rightExpression": {
        "leftExpression": null,
        "operatorUri": null,
        "rightExpression": null,
        "value": {
          "uri": "urn:replicon:approval-status:approved",
          "uris": [],
          "bool": null,
          "date": null,
          "money": null,
          "number": null,
          "text": null,
          "time": null,
          "calendarDayDurationValue": null,
          "workdayDurationValue": null,
          "dateRange": null,
          "dateTimeUtc": null
        },
        "filterDefinitionUri": null
      },
      "value": null,
      "filterDefinitionUri": null
    },
    "value": null,
    "filterDefinitionUri": null
  }
}
Photo of Coleske, Gustav

Coleske, Gustav

  • 2 Posts
  • 1 Reply Like
Thank you Aashnee.  That works like a charm.