Questions tagged [gtl]

SFMC Guide Template Language is an email scripting supplement to AMPScript and Server-Side JavaScript.

Filter by
Sorted by
Tagged with
0
votes
2answers
34 views

Parsing through JSON

I have submitted a Json string to a data extension under the field name of "products" and can see the data within Marketing Cloud: Example data: [{"name": "Lunch1", "...
0
votes
1answer
35 views

Continuous Pull in Ampscript, GTL, or SSJS from a JSON file

I am trying to find the best method in a Marketing Cloud email to continuously pull data from a JSON file that updates every 5 seconds so that it is "Live" Data within the email. Currently I ...
0
votes
1answer
66 views

using AMPscript variable instead of the target Data Extension's name in Guide Template Language dataobject type list

I am building an email in Content Builder that will show GTL variables but I want to set an AMPscript variable to the target Data Extension’s name. I find that I can use AMPscript variables in the GTL ...
0
votes
1answer
174 views

Can't get GTL to loop through a JSON array of strings without keys (unordered)

I've been having a lot of success parsing JSON with GTL for emails, but there's something that I just cannot get to work. Given the following JSON { "category1": "something", "category2": "...
0
votes
1answer
85 views

Parse nested JSON using GTL in CloudPage

I am trying to parse a nested JSON in CloudPage using GTL. I have reviewed the comments from other cases on this topic but unable to figure out the issue. Can someone review it and let me know if I am ...
0
votes
0answers
41 views

Data Relationship Email

I'm trying to create an email that uses information from two data extension in which only one contains an email address. I've used the below HTML and have connected the two data extension in a data ...
0
votes
0answers
49 views

Targeting Arrays in Guide Template Language

I have a requirement where I need to design an IF statement based on the value of specific items in an array. Here's what I'm working with: "shipments": [ ...
0
votes
0answers
28 views

Guide Template Language: multiple filters

I seem to be having some trouble puling specific product info from a data extension. I can pull one product, or I can pull all the products, but not a certain set. I'd like to be able to enter 4 skus ...
2
votes
1answer
139 views

GTL in a HTML Email

I am using Guide Template Language (GTL) in a HTML email to output data in a table format. The table alignment is off when displaying data from the attributes. I notice that an extra blank column ...
0
votes
1answer
120 views

How display the cities array info?

Set @record_search = '{"age":42,"cities":["Cobbtown, GA","Metter, GA"]}' {{.datasource JSONVar type=variable source=@json maxRows = 20}} {{.data}} { "target" : "@record_search" } {{/data}} %%[ for @...
2
votes
2answers
535 views

AMPScript/GTL function to check if variable is string or a numeric

Need to check a type of variable in ampscript, in order to use FormatNumber function(that can only work with integer variables). I tried the Handlebars function {{isString()}}, but can't make it ...
2
votes
2answers
221 views

First “0” is missing when displaying a number starting with “0”, with GTL

I need to display numeric value in transnational email. I'm parsing json with GTL. Some times the payload can have a value like 012345, but in the email the display is 12345. I tried to format with ...
1
vote
2answers
79 views

Comparing records from Data extension

I have a weird situation, I need to check a value in an Data Extension and if the value is not there, I need to update another data extension. But if the value is there, the data extension should not ...
0
votes
1answer
563 views

GTL and multi nested JSON

I need to send an email and update a data extension based on JSON content. I've written code combining GTL and AMPscript but I keep getting errors. And also since this is my first time using GTL and ...
1
vote
2answers
562 views

GTL Basic Personalization example

I'm new in using GTL, I want to know if someone has an example of a GTL Basic Personalization. I have this JSON :{ “First Name” : “Angela”, “Last Name” : “Cruz”, “City” : “Chicago”} and this html: &...
2
votes
0answers
470 views

Set GTL output in AMPSCRIPT variables

hope that someone can help me here: I'm trying to retrieve a simple result from a POST api call into ampscript variables. The cloudpage does show the variables as GTL, but when I try to display them ...
1
vote
0answers
70 views

GTL comparisons

I have the following GTL code wich workes fine: {{#if Months!=""}}{{Months}}{{/if}} However i want to do a double check. So i want to check if the field weeks is empty or greater than 1. I tried ...
2
votes
0answers
147 views

GTL Json data looping

I have a GTL code that loops through my JSON code. In the JSON string i have several order data but in each array there is the same adress information like so: [{ "name":"This is a name", "sku":"8547"...
1
vote
0answers
132 views

GTL conditional display of JSON content based on later values

EDIT: It occurred to me that there is a much simpler, broader way of asking this (or at least very relevant to it): is there a way to pull unique values from a JSON attribute, e.g. within the ....
2
votes
1answer
574 views

Using GTL to Display Data from Nested JSON Arrays

I am building an email using data passed through JSON. Here is an example of the JSON file: { "order": { "items": [ { *Other Data*, "tracking": [ { **"...
0
votes
1answer
137 views

GTL counting Json string

I have set up a GTL and AMP script that looks at my attributes where i passed in a Json string (array). This is the string: `[{"MiddleName":"der","LastName":"Test"},{"MiddleName":"van der","LastName"...
1
vote
0answers
149 views

GTL - Can't use inside a content block?

I created a code snippet that contains AMPscript and GTL: %%[ /*API Subscriber Config*/ ContentBlockByName("Content Builder\_EmailAssets\Code Snippets\API Subscriptions\API Subscriber Config") SET @...
1
vote
1answer
169 views

Using Journey Context data in email

Is there any way to retrieve a Journey's context data (definitionInstanceId, journeyId) using AMPscript, GTL or SSJS in an email ?
0
votes
1answer
745 views

Can you parse custom JSON data using GTL/AmpScript? [closed]

I am trying to send out personalized emails using GTL and AmpScript but i was wondering if you can pass custom data in the form of a JSON object within a data extension For example if a Data extension ...
0
votes
1answer
129 views

Idea: Improve dynamic content blocks (VAWP-related)

Salesforce support told me i should create a case on stackexchange to get votes on this idea because they admitted it is an gap in product. Here is a link to the problem: Dynamic Content blocks inside ...
1
vote
0answers
100 views

Journey Data in Mobile Push

I am trying to personalize a Push message with Journey Data coming from API call. I am trying to use GTL but it is not working. {{Event.Event-Definition-Key.Attribute-name}} Thanks!
2
votes
0answers
370 views

Ampscript Loop : Multiple rows needed in multi-column email layout

My newsletter was set up to loop per row in the DE to fill in needed info into a content block that gets created up to 35 times. There has been a new content block that now requires I pull two or more ...
1
vote
1answer
445 views

GTL in cloudpages: #with

If I have this json: { "name":"Tania", "invoice":{ "city":"BCN", "zip_code":"1005", "amount":"56.13", "datetime":"05/09/2017", "address":"Calle", "name":"...
1
vote
1answer
414 views

Unable to parse JSON using Guide Template Language

I have a Json Input string , while parsing the Json the Description field value is breaking into another line, why this line is breaking %%[ var @Json set @Json = '{ "ArticleCount": ...
9
votes
1answer
343 views

How to express the last iteration of #each in Guide Template Language?

I am trying to use json arrays in my email using Guide template language and the issue is I need to stop showing the divider line on the last iteration of {{#each}} loop. I have tried {{@last}} or any ...
2
votes
1answer
316 views

GTL in a Content Area

I'm using GTL (Guide Template Language) on the body of an email where I want to show some images dynamically and works well. But, to let the email more "clean" I want to copy that GTL code on a ...
1
vote
1answer
307 views

GTL : Journey Data and Contact Data inside Journey Builder Email activity

I want to use GTL with Journey Data and Contact Data to personalize an Email with information stored in Contact Builder and information coming from an API event triggered by an external system. I am ...
0
votes
1answer
413 views

Using Guided Template langauge with Ampscript

I am using GTL with Ampscript to personalise an SMS by creating the task activity in Journey Builder which then talks to Salesforce data and triggers a SMS. I have used the description field to insert ...
0
votes
0answers
79 views

Content pulled from JSON becomes ASCII encoded when special character

I am successfully pulling content from a JSON feed into an email using set @json = TreatAsContent(HttpGET("https://test.com/fakeaddress")) The feed contains a lot of special characters (åäöé) and ...
2
votes
1answer
589 views

How to access sub item in json using Guide template language in this code?

I am using Guide template language to pull content from a remote url. This works but takes the title from too high up in json structure: {{.dataobject JsonVar type=variable source=@json maxrows=3}} {...
4
votes
2answers
1k views

Looping through json in email - impossible?

This nested Guide Template Language snippet brings me 6 rows of titles. Problem: I have a complex layout in an email and I want to populate it with titles in different places. I can not make a ...
1
vote
3answers
1k views

Guide Template Language blocks displayed in CloudPages

I can't figure out how to get GTL working on CloudPages. I was informed that it should work. Here's my HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"&...
1
vote
1answer
346 views

Cannot set data type for variables in Guide Template language

According to the documentation you should be able to set the data type of a variable using a kind parameter: N - number C - currency D - date For example: {{example [kind=N]}} or {{example [k=N]}...
0
votes
1answer
173 views

Unexpected behavior when using multiple datasource blocks in Guide Template Language

As per the GTL documentation you open up the datasource to start using it, then close it off at the end of the content: {{.datasource datasourceName [type=<datasourcetype>] [maxRows=<int>]...
0
votes
1answer
290 views

Mustache tag containing space characters are not displayed in Guide Template Language

I'm having issues with space characters in JSON object names. GTL does not find the names in a JSON object if the name contains spaces. I have a "Shipping Address" JSON object that looks like this (...
3
votes
0answers
114 views

Un-Escaped HTML for Variables in Guide Template Language Not Working

We have HTML templates in ExactTarget that use variables passed in via the REST API. The variable contains text with HTML entities. I read the following documentation for the Guide Template Language....
6
votes
1answer
885 views

How does Guide Template Language parse a straight JSON array?

I'm learning Guide, and I've been able to parse an array of objects... AmpScript: set @json = '[{"voucher":"123456789"}, {"voucher":"234567890"}]' Guide: {{.dataobject JsonVar type=variable ...
0
votes
1answer
908 views

Cannot store JSON object in Data Extension

We are storing a JSON object in a Data Extension field, then using GTL to parse the JSON and retrieve nested values in the object. It's working really well. However, the challenge is to get the JSON ...
0
votes
2answers
2k views

Json parse in emails with ampscript

Im trying to parse some weather json data in my email. But I cant quite fiqure out the syntax. With this code I'm trying to get the main.temp value printed. Below is my code so far, but it dosnt work :...
2
votes
1answer
1k views

Guide Template Language to provide dynamic links via href attribute from JSON

I'm using GTL to parse a JSON attribute coming from a Data Extension. Everything works fine except links in href attribute. For some reason/limitation they don't render in the href attribute. I was ...
0
votes
2answers
4k views

Parse JSON string in AMPscript

We are currently passing a string attribute via the REST API that contains JSON. { "User_List": "[{\"name\":\"john doe\", \"email\":\"john.doe@mail.com\"}, {\"name\":\"jane doe\", \"email\":\"jane....
1
vote
3answers
1k views

Guide Template Language to provide dynamic links via href attribute

I'm trying to use the Guide Template Language to provide a dynamic link in a triggered send, something like this: <a href="{{My_Url}}">{{My Url}}</a> or <a href="{{My_Url}}">Your ...
0
votes
2answers
1k views

How to access nested JSON (sub-objects) in data

I'm using the dataobject tag to parse JSON that is in a variable as described by: https://help.exacttarget.com/en-US/documentation/guide_template_language/parsing_json/dataobject_tag_examples/ How ...
1
vote
1answer
740 views

Can the guide template language be used with content in a microsite?

Can the guide template language be used with content in a microsite? If it can then please describe change required to following to allow it to display same as email content. <script runat=server&...
4
votes
2answers
990 views

Define a function in Guide Template Language

Documentation for Guide template language has an example of how to call a function, but nothing on how to define a new function. Any advice on this? Tried: Defining in a server-side JS block &...