Hi,
Having some trouble with conditions.
{{ $users := (where $.Site.Data.internal.users “Administrator” “eq” “True”) }}
Works as expected and users are greater then 0.
Then i try filtering one more time on a property inside that user.
{{$filtered_users := where $users “Last_Logon” “le” (now.AddDate 0 0 -90) }}
But this gives me a result of zero.
{{len $users}} = Non zero
{{ len $filtered_users }} = should be greater then zero, but are 0.
I can however do below to give me my results but then i cant “sum them up” like i intended with
{{ len $filtered_users}}
{{ range where $.Site.Data.internal.users “Administrator” “eq” “True” }}
{{ if le .Last_Logon (now.AddDate 0 0 -90) }}
{{ .username }}
{{ end }}
{{ end }}
if someone has a more clean solution to both present the content and be able to count them then im all ears.
Now we’re performing a string comparison. Although not ideal (date-to-date comparison is preferable), you should be OK provided that the format of the LastLogon in your JSON data is consistent.