Skip to main content
September 8, 2023
Solved

How to Generate Report Based on the User Filters

  • September 8, 2023
  • 7 replies
  • 0 views

Hello,

In a interface using process model I'm generating the Report in Excel using Export Data Store Entity To Excel Smart Service on Monthly and daily basis, and in smart service inside filter field I'm providing filters to filter the data.

Now the requirement is that I need to take inputs from user like the From Time and To Time, and based on this I need to filter the data from the database and generate report in excel which is present between the time period provided by the user in interface. 

Thank you.

    Best answer by mathieud0001

    a!localVariables(
      local!endDate: now(),
      local!startDateTime45Days: a!subtractDateTime(
        startDateTime: local!endDate,
        days: 45
      ),
      local!startDateTime: userdatetime(
        year(local!startDateTime45Days),
        month(local!startDateTime45Days),
        day(local!startDateTime45Days),
        0,
        0,
        0
      ),
      local!endDateTime: userdatetime(
        year(local!endDate),
        month(local!endDate),
        day(local!endDate),
        23,
        59,
        59
      ),
      a!queryFilter(
        field: "timestamp",
        operator: "BETWEEN",
        value: { local!startDateTime, local!endDateTime }
      )
    )

    I provided something similar to this in another thread you srtarted: https://community.appian.com/discussions/f/general/29915/to-find-if-a-given-date-is-from-previous-month

    7 replies

    mathieud0001
    Brainy
    September 8, 2023

    Can't you just capture the values for those filters in your interface and pass them as process variables to your process and then build your queryFilters inside your process model based on those PVs?

    September 8, 2023

    But if the user need the last 45 days record in excel, then how to implement it.

    mathieud0001
    Brainy
    September 8, 2023

    You pass a startDate and endDate captured in your interface as PVs to your process and and you apply the filters using those dates?