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.
Discussion posts and replies are publicly visible
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?
But if the user need the last 45 days record in excel, then how to implement it.
You pass a startDate and endDate captured in your interface as PVs to your process and and you apply the filters using those dates?
He is not passing start date and end date, only he is passing 45 days before as a input from interface.
Then simply calculate the startDate by subtracting 45 days using subtractDateTime?
endDate would be today I presume.
Can you provide an example for this and thank you so much.
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