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
0answers
11 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
58 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
0answers
62 views

How to Send a JSON Arrray From Sales Cloud to Marketing Cloud via API?

I'm using the Marketing Cloud transactional messaging API to send emails from Marketing Cloud that originate in Sales Cloud. Everything works well except sending a JSON array of attachments. The issue ...
0
votes
1answer
86 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
211 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
90 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
54 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
258 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
294 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
222 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
48 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
110 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
88 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
291 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
101 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
107 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
117 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
431 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
100 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 ...
1
vote
0answers
92 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
286 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 ...
0
votes
1answer
357 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
374 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
304 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
278 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
249 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
329 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
65 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 ...
1
vote
1answer
501 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
760 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
814 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
303 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
148 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
136 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
108 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....
1
vote
0answers
637 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
642 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
1k 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
952 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
3k 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
685 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
915 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 &...
18
votes
4answers
8k views

Can AMPScript parse JSON?

Using AMPScript to parse an XML feed. Client is switching to JSON. Is there something similar to BuildrowsetfromXML() for JSON in AMPScript? I am confined to using the members login area and not an ...