6

I'm using Azure Logic Apps to call out to the Microsoft Graph API using the HTTP - HTTP action. For this API I need to execute a POST request with the following body:

{
   "@odata.id": "<guid>"
}

When I try to save the Logic App, this error shows:

Failed to save logic app <redacted>. The template validation failed: 'The template action '<redacted>' at line '1' and column '144589' is not valid: "Unable to parse template language expression 'odata.id': expected token 'LeftParenthesis' and actual 'Dot'.".'.

How can I use this attribute in my JSON payload?

EDIT: as requested, a screenshot of the part of the Logic App that generates the error on Saving. dot in attribute triggers save error

dreftymac
  • 31,404
  • 26
  • 119
  • 182
Yannick Reekmans
  • 177
  • 2
  • 12
  • Welcome to Stack Overflow! Since you're new here, I recommend reading ["How do I ask a good question?"](https://stackoverflow.com/help/how-to-ask) for some tips. Your question is lacking sufficient detail to help the community help you. – Marc LaFleur May 08 '18 at 19:10
  • Could you share a bit of code of your logic app, specifically on the part that generates the error? This could help us determine what is wrong with the syntax. – zurebe-pieter May 08 '18 at 20:19
  • @PieterVandenheede I added a screnshot of the action. When configured like this, I cannot save the Logic App because of the '.' in '@odata.id' – Yannick Reekmans May 08 '18 at 20:32
  • 2
    @YannickReekmans `@` is a protected keyword in the logic app workflow definition language schema. can you try this `@@odata.id` please ? – Thomas May 09 '18 at 05:30
  • @Thomas If you convert your comment as an answer, I will accept it! Thank you for the help! – Yannick Reekmans May 09 '18 at 10:55

1 Answers1

17

From this article:

Logic Apps workflow definitions with the Workflow Definition Language schema

If you have a literal string that starts with the @ character, prefix the @ character with another @ character as an escape character: @@

So in your case, this should work:

{
  "@@odata.id": "your value here"
}
Thomas
  • 24,234
  • 6
  • 81
  • 125