Questions tagged [vtl]

The Velocity Template Language (VTL) is meant to provide the easiest, simplest, and cleanest way to incorporate dynamic content in a web page.

VTL is the Velocity Template Language.

It includes Variables, Properties, Methods, Directives, Macros, and more...

Reference: http://velocity.apache.org/engine/2.0/vtl-reference.html

193 questions
0
votes
1 answer

Dynamodb conditional update add or remove based on condition

I have a dynamodb table in which one column is of type Map. I want an update query which removes the item from the map if the item is in the map or add the item to the map if the item is not in the map. How can i write a VTL fro this problem ?
0
votes
1 answer

How to get the last element inside array using VTL?

I am writing AWS AppSync resolver. Where I do need to get the last element in my array. AWS AppSync supports VTL language. Example: #set($items=["color", "taste", "shape"]) #set($result="shape") I am using $array.size() but didn't work. I don't see…
Jha Nitesh
  • 188
  • 1
  • 11
0
votes
1 answer

Check if property exist (Lexical error _ after .)

I have this snippet that's causing lexical error #if( $context.args.input._publics ) $util.unauthorized() #end The error message is Lexical error, Encountered: \"_\" (95), after : \".\" How do I check if property _publics exists at…
cocacrave
  • 2,453
  • 4
  • 18
  • 30
0
votes
1 answer

AWS AppSync - DeleteItem doesn't execute response mapping template

When attempting to delete an item using the following request mapping: { "version" : "2017-02-28", "operation" : "DeleteItem", "key" : { "id": { "S" : "$ctx.args.id"}, "sortKey" : { "S" : "$ctx.args.sortKey"} } } If the item…
Chris
  • 189
  • 1
  • 1
  • 5
0
votes
1 answer

AppSync HTTP Resolver IAM Authorization Error

I am trying to use http resolvers with AWS AppSync so that we can support using graphQL and our REST APIs simultaneously. I got the AppSync http resolver working when the API Gateway did not have any authorization setup on it. However, I've now…
0
votes
1 answer

Test Resolver in AWS AppSync w/ API Key?

Currently AWS AppSync provides an option to add test context to test your resolver to make sure everything is correct. However, because I am using API Key for authentication, I'm not sure of a way to set this in the request mapping template so that…
C. Lewis
  • 145
  • 1
  • 6
  • 17
0
votes
1 answer

Using VTL Velocity, how can I create VALUES array to use in SQL Statement

I am trying to create an SQL Statement in my AWS resolver which uses Values. For example: #set( $inserts = [] ) #foreach ( $item in $ctx.args.input.listItems) $util.qr($inserts.add( ['$item.item_id', '$item.item_name', 'item.item_image_id']…
alionthego
  • 8,508
  • 9
  • 52
  • 125
0
votes
0 answers

Images in Velocity Word Template

I'm trying to pull images from a platform working with tables. Within the platform, there are document automation capabilities based on vlt. The VTL code is written within a word file that is then uploaded to the platform. I'm trying to pull images…
martin
  • 1
0
votes
1 answer

AppSync to DynamoDB update query mapping error

I have the following DynamoDB mapping template, to update an existing DynamoDB item: { "version" : "2017-02-28", "operation" : "UpdateItem", "key" : { "id": $util.dynamodb.toDynamoDBJson($ctx.args.application.id), "tenant":…
Ewan Valentine
  • 3,741
  • 7
  • 43
  • 68
0
votes
1 answer

AppSync BatchGet Filtered Returns Limit Error

Background We're using AWS AppSync with attached DynamoDB data sources. We've run into a really perplexing situation when attempting to filter queries before returning batch results to our clients. The goal is to filter our results based on…
0
votes
1 answer

Is it possible to use VTL to randomise a DynamoDB query result?

I have an AppSync API, and there's a requirement to return the data in a randomised order. This is what I have currently, I have no idea where to start and can't find any docs on this. { "items": $util.toJson($ctx.result.items) }
Ewan Valentine
  • 3,741
  • 7
  • 43
  • 68
0
votes
1 answer

How to convert the response of aws API gateway from json to XML?

I have created an API for SQS(FIFO) and its working fine but its returning Json response but I need XML response. Below is the Json response which need to be converted before sending to client: { "ReceiveMessageResponse": { "ReceiveMessageResult":…
Rock
  • 101
  • 3
  • 15
0
votes
1 answer

AWS AppSync add multiple children into one parent attribute with existence check resolver

I have a question of AWS AppSync. I wonder whether there is a way to check existence while adding multiple values into one attribute of the parent. So, here is my example: This is User type: User type Here is what the dynamodb looks like: dynamodb…
Harrison Song
  • 61
  • 1
  • 4
0
votes
0 answers

Generate Word document with updated TOC using Velocity template

I am currently working on a Velocity template for exporting data from the JAMA platform. I am required to follow an specific document format. This format includes a table of contents that currently is correctly created in the document. The issue is…
0
votes
1 answer

Telligent 10 - Velocity Template - get current datetime

Using Telligent 10 platform and their native Velocity Template Language, how can we simply get the current datetime? Per the many examples I've seen here on SO these first two require the $date var previously defined and those examples all define…
id.ot
  • 3,071
  • 1
  • 32
  • 47
1 2 3
12
13