Forum Discussion
Using a catalog to populate a push based on date
Hi.
I created a catalog in Braze with 3 fields:
id
title
preheader
The id column is a date yyyy-mm-dd
I then created a selection where id equals {{today}}
I followed Braze support to use this as my push message:
{% catalog_selection_items anchor today %}
{{ items[0].preheader }}
However, nothing is populating.
Does anyone have a solution?
3 Replies
- eakinsey
Community Manager
Hmmmmm... the only thing that sprang to mind was verifying the catalog has entries for the current date? If there are no entries for {{today}}, the selection will return empty.
- HariSirigiri1Influencer
Hi, if you are using liquid for {{today}}, please make sure to add the time zone that you're checking from.
- SachinDhirSupporter
Try using code snippet like below:
{% capture currentDate %} {{ "now" | time_zone: 'Australia/Sydney' | date: "%Y-%m-%d" }} {% endcapture %} {% catalog_items my_catalog {{currentDate}} %} {{items[0].preheader }}
This should work as we are using successfully.
Make sure to update the time_zone to your environment's timezone.
Related Content
- 12 months ago