...
The app runs and, with no value for
last_run
specified (because this is the first run), we default to 30 days ago usingself.tcex.utils.format_datetime('30 days ago')
.Because our application uses
last_run
to determine the delta for data we should acquire, our initial payload will always be 30 days in the past.Once we successfully acquire and commit this data payload, we use
self.tcex.results_tc('last_run',self.tcex.utils.format_datetime('tomorrow'))
to record the new value as tomorrow to be used on the next run.
...
You can find the documentation on the suitable values and other uses for
format_datetime
here.You can find the definition of the
results_tc
method here and any additional information here.You must properly define the last_run input in your application.
You should not make the last_run parameter required in any context. The initial run of the application should have this blank so that a default value is used.
You should not show the last_run parameter in the Feed Deployer Wizard (if used).