Understanding the Problem
A community member asked about displaying attribute groups in a custom activity interface for sending SMS via a third-party gateway, not using Mobile Connect.
This requires fetching and displaying the ‘Contact Data and Journey Data’ attribute groups list, which can be achieved using Postmonger and data binding.
Data Binding with Postmonger
Postmonger provides a way to access journey-related items, including activities and clicks, but it may not be immediately clear how to access attribute groups and contact data.
However, by using Postmonger’s data binding feature, developers can fetch and display the required attribute groups.
Example Code and Resources
For a more detailed understanding, developers can refer to the official Salesforce documentation on data binding and Postmonger: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/how-data-binding-works.html
example.js
const postmonger = require('postmonger');
const journeyData = postmonger.getJourneyData();
const attributeGroups = journeyData.attributeGroups;
// Use attributeGroups to display the required data
The root cause of this issue is the lack of clear documentation on how to access attribute groups and contact data using Postmonger.
Best Practices and Next Steps
To successfully display attribute groups in a custom activity, follow these best practices:
Checklist
- Use Postmonger to access journey-related data
- Utilize data binding to fetch attribute groups and contact data
- Refer to official Salesforce documentation for guidance
- Test and validate the custom activity thoroughly
- Consider using example code and resources from reputable sources
What is Postmonger?
Postmonger is a library provided by Salesforce to access journey-related data.
How do I access attribute groups using Postmonger?
You can access attribute groups using Postmonger’s data binding feature.
What are some resources for learning more about custom activities and Postmonger?
You can refer to the official Salesforce documentation, as well as example code and resources from reputable sources.
Can I use Postmonger for other journey-related tasks?
Yes, Postmonger can be used for a variety of journey-related tasks, including accessing journey data and creating custom activities.
Need help shipping this in production?
Genetrix builds and untangles Salesforce Marketing Cloud and Agentforce setups for teams that want it done right the first time. If anything in this post sounds familiar, talk to us before it ships.