2

I've noticed that each time I'm using Azure Logic Apps Tools for Visual Studio (v2.11.15) and perform a Save, it surrounds some of the parameters in the josn file with curly brackets.

Eg, for a webhook, "@triggerBody()" becomes "@{triggerBody()}" and "@parameters('myKey')" is updated to "@{parameters('myKey')}"

What is the difference between the two syntaxes? I've noticed a string encoding when the curly brackets are added, but is this to be expected when using braces?

dreftymac
  • 31,404
  • 26
  • 119
  • 182
Horia Toma
  • 1,099
  • 2
  • 17
  • 29
  • Can you not whether or not this is causing any problems? I suspect no because they're technically the same. Just that the braces explicitly denote an object instead of presuming it. – Johns-305 Feb 07 '18 at 13:40
  • I'm forwarding a JSON payload received on a Webhook (by using triggerbody mentioned in the question) and when the braces are added, it is re-encoded and tricks the clients. – Horia Toma Feb 07 '18 at 13:44

1 Answers1

4

Expressions wrapped in @{ ... } will return a string and can be used in string interpolation.

For example, if your myKey parameter is the number 42:

  • @parameters('myKey') returns 42 as a number.
  • @{parameters('myKey')} returns 42 as a string.
  • You could use it like this - "favouriteNumber" : "My favourite number is @{parameters('myKey')}"

There's more information about expressions in the Workflow Definition Language Schema for Azure Logic Apps docs.

eimajtrebor
  • 143
  • 5