Forum Discussion
Action Path based on custom attribute
Hello,
I have a custom attribute in my dashboard giving me the total number of people you're currently following (let's call it nb_following). I want to start sending communications as soon as users reach a certain number of following (let's pretend at least 10 people) during a fixed period of time (4 days).
To do so, I thought about using an Action Path in my canvas, in which users would go through the next steps right away after their nb_following >= 50 during this period of 4 days. That would be so easy, however, it's currently not possible to chose a filter other than "change to any value" or "change to exactly the X value" in an action path (too bad...).
Have you already implemented something in a canvas that would do this?
Thank you!
Hi TillaSennane
That’s a bit of a bummer with custom attributes 😅 In an Action Path you can only use “change to any value” or “change to exactly X”, so there’s no native way to check something like nb_following ≥ 10 or 50 when the attribute updates.
Based on my experience, one workaround that works well is to convert the custom attribute change into a custom event, since custom event properties do support “greater than / less than” filters in action path.
Here’s the approach:--> Create an action based canvas that triggers whenever the custom attribute nb_following changes to any value.
-->In that canvas, add a Webhook step.The webhook calls Braze’s /users/track endpoint to fire a custom event such as followers_count.
Pass the current nb_following value as an event property.
You’ll need to create an API key in Braze with permission to track users and events, and use it in the webhook’s Authorization header.
Example webhook call:
POST https://{{instance_url}}/users/track
{ "events": [ { "external_id": "{{${user_id}}}", "name": "followers_count", "properties": { "nb_following": "{{custom_attribute.${nb_following}}}" }, "time": "{{${time}}}" } ] }Once this is in place, you can use the followers_count custom event as your entry trigger or within an Action Path, apply basic nester property filters like nb_following ≥ 10, and then manage your 4 day logic cleanly inside the current canvas.
Setup and testing should take less than a couple of hours if you’re already familiar with webhooks in Canvas, based on my experience.
Also, if the Action Path needs to sit after a communication is sent or you have multiple steps in the same canvas, this is probably the best solution since it keeps everything within Canvas and works around the custom attribute limitations.
Hope this helps!
EDIT: Please note every single custom event count towards a single data point.
5 Replies
- NirnayMentor
Hi TillaSennane
That’s a bit of a bummer with custom attributes 😅 In an Action Path you can only use “change to any value” or “change to exactly X”, so there’s no native way to check something like nb_following ≥ 10 or 50 when the attribute updates.
Based on my experience, one workaround that works well is to convert the custom attribute change into a custom event, since custom event properties do support “greater than / less than” filters in action path.
Here’s the approach:--> Create an action based canvas that triggers whenever the custom attribute nb_following changes to any value.
-->In that canvas, add a Webhook step.The webhook calls Braze’s /users/track endpoint to fire a custom event such as followers_count.
Pass the current nb_following value as an event property.
You’ll need to create an API key in Braze with permission to track users and events, and use it in the webhook’s Authorization header.
Example webhook call:
POST https://{{instance_url}}/users/track
{ "events": [ { "external_id": "{{${user_id}}}", "name": "followers_count", "properties": { "nb_following": "{{custom_attribute.${nb_following}}}" }, "time": "{{${time}}}" } ] }Once this is in place, you can use the followers_count custom event as your entry trigger or within an Action Path, apply basic nester property filters like nb_following ≥ 10, and then manage your 4 day logic cleanly inside the current canvas.
Setup and testing should take less than a couple of hours if you’re already familiar with webhooks in Canvas, based on my experience.
Also, if the Action Path needs to sit after a communication is sent or you have multiple steps in the same canvas, this is probably the best solution since it keeps everything within Canvas and works around the custom attribute limitations.
Hope this helps!
EDIT: Please note every single custom event count towards a single data point. - Manoj__Visionary
Hello TillaSennane The best way is what Nirnay mentioned.
Note that based on your contract you are either charged on data points or the new Message sends. If you are charged based on message sends then you a context variable step to do connected_content API call to trigger the event.
- NirnayMentor
Hi Manoj__ ,
First of all, thanks for all your contributions to bonfire, learned so much from your solutions.Secondly, that’s a smart way of using context variables!
However, I do have some reservations about using Connected Content to trigger custom events.
According to Braze’s documentation, Connected Content API calls can be executed multiple times per recipient. I’ve seen this firsthand as well, when using the user track API via Connected Content in emails to generate and retrieve real-time promos, we later discovered that multiple promos were being generated for a single user, even though we expected only one API call.
In the TillaSennane use case, using Connected Content could result in the associated custom event being triggered multiple times. While I don’t see an immediate risk for Tilla’s specific scenario, I’d be hesitant to recommend this pattern more broadly, especially if that same custom event might later be reused for other use cases.
This aligns with Braze’s guidance, which notes that:
- Braze may make the same Connected Content API call more than once per recipient for rendering, validation, retry logic, or other internal reasons. braze doc
Given this behavior, it’s generally safer to avoid side effects (like attribute updates or event triggering) inside Connected Content calls, unless the downstream impact is very carefully controlled.
Correct me if my understanding is wrong! Thank you
- TillaSennaneSupporter
Related Content
- 1 year ago
- 2 years ago