0

Having a tough time with ExactTarget's documentation. The example below from their docs works just fine, but I'm having trouble setting the var Json to an actual JSON feed. What am I missing?

 %%[ var @Json set @Json = ' [{"emailaddress":"john@example.com","Region":"West","State":"California","City":"San Francisco"},
 {"emailaddress":"carla@example.com","Region":"Central","State":"Indiana","City":"Indianapolis"}]' ]%%

 {{.datasource JSONVar type=variable maxRows = 20}}
    {{.data}}
    { "target" : "@Json" }
    {{/data}}
    Email Address: {{emailaddress}}
    Region: {{region}}
    State: {{STATE}}
    City: {{JSONVar.City}}
 {{/datasource}}
ok1ha
  • 637
  • 1
  • 11
  • 30

1 Answers1

1

Have you looked into using Server-Side Javascript? Ampscript does not contain a function for parsing JSON. However, SSJS does.

Also for future reference, consider posting you questions at salesforce.stackexchange.com under the tag Marketing-Cloud.

reference:

David Devoy
  • 186
  • 8