Liquid
44 TopicsLiquid arrays personalization
Hello everyone I'm trying to implement this liquid code in one of my templates: {% assign combinedResults = canvas_entry_properties.${data}.results | concat: canvas_entry_properties.${data}.featuredResults %} {% assign results = combinedResults | sort: 'totalEstimatedCost.amount' | reverse %} The arrays canvas_entry_properties.${data}.results and canvas_entry_properties.${data}.featuredResults are two arrays that contain a list of offers, with each offer having a name, an ID, and a totalEstimatedCost.amount Using this Liquid code, I want to first create a third array called combinedResults that merges the offers from both canvas_entry_properties.${data}.results and canvas_entry_properties.${data}.featuredResults. Then, I want to sort this combined array so that the offers are displayed in descending order based on totalEstimatedCost.amount, from the highest to the lowest price However, the issue is that the displayed list first shows the two offers from the featuredResults array sorted in ascending order (from the smallest to the largest price), followed by the five offers from the results array sorted in descending order (from the largest to the smallest price). Do any of you know why this could happen? the structure of the original arrays is the same. Thank you in advance!43Views1like2CommentsHelp: Liquid logic, conditional messaging & nested custom attributes.
Hello! I need help understanding where i'm going wrong with my conditional messaging. Is it possible to search and dynamically pull a specific value from a nested profile using Liquid code in a Braze email? Example: Users have a nested custom attribute called 'Colour'. User 1 is associated with two profiles: Company A (nested profile [0]) and Company B (nested profile [1]). The value of 'Colour' for Company A is 'Green', while for Company B it is 'Purple'. How can I dynamically retrieve the 'Colour' value for a specific company (e.g., Company A)? Note: I haven't used [] indexing as I want to look across all associated profiles per user to filter down for the correct value (example above). And the testing code: {% assign found = false %} {% for Partner_Name in custom_attribute.Profiles %} {% if Partner_Name == "Onsi" %} Your partner ID is {{custom_attribute.${Profiles}.Partner ID}}. {% assign found = true %} {% endif %} {% endfor %} {% unless found %} You do not have a partner ID associated with this account. {% endunless %} Thank you for any help or suggestions you have!102Views4likes5CommentsHow to change the date format in an email using liquid
Hi everybody, greetings from Germany! I want to display the date format of a custom property in an email in a different way. In the propery, we save the date in this format: YYYY-MM-DD hh:mm:ss. I'd like to display the property in the email in this format: DD.MM.YYYY Does anybody know how I can achieve that? Thanks so much for your support!Solved802Views0likes7CommentsConnected content making 2 calls
Hi I have this connected-content in email template; but when I send out, its always making two POST API calls; I'm adding customers in a list in a survey module and every time my canvas sends out email; it adds customers twice. Is there any way to prevent this? Thanks //Waqas {% capture payload %} { "contactDetails": "{{${email_address}}}" } {% endcapture %} {% connected_content {{ url }} :method POST :headers { "Content-Type": "application/json", "X-API-KEY": "xxx" } :body {{payload}} :content_type application/json :no_cache :save add_response %}52Views0likes3CommentsAudience Path through event properties
Hello community! I need your help to set up a Canvas Flow: Context: In our subscription we are customising the unsubscribe flow based on the reason. We register this reason as an event property of the event that triggers the flow ( subscription cancel complete). Problem: It does not find the way to direct the users in a flow or another depending on the property of the event, since the ''audience path'' tool does not allow to split by event property. How would you do it? I could do it through conditions and liquid, but the flows are not exactly the same for all properties/reason. Thank you very much!Solved104Views1like4CommentsLiquid Country Help Please!
I am trying to create a piece of dynamic content that shows for multiple countries. I have created this code which worked a few weeks ago, but now isn't working: {% if {{${country}}} == 'ID' and 'AE' and 'TR' and 'EG' and 'SA' and 'PK' and 'BD' and 'MY' and 'NG' %} I have tried with or and that doesn't work either! Any help would be massively appreciated, thank you.859Views1like6CommentsLoop through a catalog to display the product a user has as a custom attribute
Hello, So I am trying to display some Liquid logic into an email template. The idea is that I have a catalog named house_properties with fields: id, name and description. Each user has a custom attribute called user_product_id which we should use in the Liquid code to display the name of the product from the catalog if the two id's are the same. This is the Liquid code I have been using, but apparently is not working. Can someone please let me know what am I missing here? {% assign user_product_id = {{ custom_attribute.${user_product_id} }} %} <!-- Loop through each row in the catalog --> {% for row in house_properties %} <!-- Loop through each item in the current row --> {% for item in row %} <!-- Check if the item name contains the user's custom attribute --> {% if item.id == {{ custom_attribute.${user_product_id} }} %} {{ item.name }} {% endif %} {% endfor %} {% endfor %} Thank you in advance! Elena483Views0likes4CommentsDyanmic barcodes and/or QR codes
I've been looking into the Braze documentation looking for a native solution for showing dynamic barcodes/QR codes in email templates, but haven't found anything. Is anyone aware of this function in Braze/Liquid Logic, or a viable alternative that can be leveraged via API's or other supported methods, that doesn't break the bank? Thanks167Views0likes3CommentsCatalog Selections personalization based on array data type
Hello , I am using Selections and want to display some personalization into an email, but apparently it's not working. The selection is taking a custom attribute of type array on the user profile and then should display both of the values in the array from the catalog. I have used the personalization feature in the email template, but it's not showing up any data. The Liquid code is as follows: {% catalog_selection_items TestNew NewSelection %} {{ items[0].property_name }} {{ items[1].property_name }} {{ items[2].property_name }} The selection looks like on the image: So basically I would like the selection to have all of the properties from the catalog that have withdrawn status FALSE and also have all the values in the array of property_instructed_id custom attribute. In this case the user I am testing with has 2 values in the array, but it's not showing up neither of them. Can you please help out on what might be the issue here? Many thanks148Views0likes1Comment