Hello,
I am trying to create a report template that has a repeat table I want to pull from. In the repeat table, I only want to show items the are >= today()-5days. How do I write this in an if statement? So far I have tried:
${repeat_name}${if material_date >= today()-5}
And
${if material_date >= dateadd(now(), -5, 'days')}
Any advice would be greatly appreciated!
First your repeat tagging should have a "#" in it and be sure to close it
${#repeat_name}${/}
This documentation has info on working with dates in reports
https://doc.arcgis.com/en/survey123/browser/analyze-results/featurereport-conditionalelements.htm
However, It says that there is no equivalent to now() and today() functions for report syntax. You could maybe limit to the say 5 most recent entries by ordering by date and returning only the 5 most recent, using "orderByFields" and "resultRecordCount"...
https://doc.arcgis.com/en/survey123/browser/analyze-results/featurereportqueries.htm
Also see this if you really want to dig in.
Try this:
${repeat_name}.query("material_date >= today() - 5") | format:"json"
@BrentBass Have you successfully implemented this and can you share any documentation for this method? I couldn't find and documentation and I tried with sample data and couldn't get it to work.