Questions tagged [gtl]
SFMC Guide Template Language is an email scripting supplement to AMPScript and Server-Side JavaScript.
53
questions
1
vote
1
answer
134
views
Dynamic Alias from Data Extension breaks URL
We have a dynamically generated multi-language email which will take the country and language combination of a subscriberkey and fetch the content from a data extension, everything is working fine, ...
4
votes
1
answer
74
views
When using GTL in my mailings, I get a broken duplicate of the Mail after the real one
Nice to be here.
I try to create an email on the basis of GTL. I open an AMPScript variable, which contains many key value pairs in a flat JSON format. I do this at the start of the mail like this:
{{....
0
votes
1
answer
162
views
Use AMPScript variable to retrieve values from nested JSON in GTL
I am trying to pass a variable into a GTL datasource to get a set of nested values from a JSON so they can be used to dynamically theme an HTML module. In the below example I am able to get the values ...
2
votes
1
answer
392
views
Using GTL for Nested JSON in Marketing Cloud Email HTML
Working on parsing some JSON in the HTML of a Marketing Cloud email using GTL and AMPscript and I've figured out how to do one degree of nesting, but can't figure out how to dig down deeper than that. ...
0
votes
2
answers
106
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
1
answer
277
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
1
answer
228
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
1
answer
590
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
1
answer
253
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 ...
2
votes
1
answer
326
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
1
answer
143
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
2
answers
1k
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
2
answers
597
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
2
answers
122
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
1
answer
1k
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
2
answers
858
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
1
answer
931
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
0
answers
116
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
0
answers
242
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
0
answers
223
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
1
answer
1k
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
1
answer
254
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
0
answers
212
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
1
answer
227
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
1
answer
1k
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
2
answers
1k
views
Getting Error while try to get Salesforce OAuth access token from SFMC cloudpages ssjs httppost?
Actually I try to get access token of salesforce DC from salesforce MC by SSJS Httppost
I need to create a record in salesforce object From Salesforce marketing cloud pages
<!doctype html>
&...
0
votes
1
answer
175
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
0
answers
116
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
0
answers
526
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
1
answer
553
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
1
answer
486
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
1
answer
513
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
1
answer
402
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 ...
2
votes
1
answer
386
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
1
answer
496
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
0
answers
135
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
1
answer
721
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
2
answers
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
3
answers
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
1
answer
420
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
1
answer
222
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
1
answer
761
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
0
answers
139
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
1
answer
1k
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
1
answer
1k
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
2
answers
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
1
answer
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
2
answers
5k
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
3
answers
2k
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 ...
1
vote
2
answers
2k
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 ...