I followed the steps in this article (link) but the automation is failing at the third step. With the error:
- Unable to process template language expressions in action 'Post_card_in_a_chat_or_channel' inputs at line '0' and column '0': 'The template language expression 'body('Parse_JSON')['sections'][0]['activityTitle']' cannot be evaluated because property 'sections' doesn't exist, available properties are 'attachments, type'. Please see https://aka.ms/logicexpressions for usage details.'.
I can see in the input/output of the Parse JSON step that nothing seems to change, hence the property 'sections' doesn't appear despite being in the schema. How do I make this work??
Error response:


Here are screenshots of the full workflow in Teams:

Parse JSON:

The JSON Schema:
{
"type": "object",
"properties": {
"summary": {
"type": "string"
},
"attatchments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"activityTitle": {
"type": "string"
},
"activitySubtitle": {
"type": "string"
},
"activityImage": {
"type": "string"
},
"activityText": {
"type": "string"
},
"facts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"value"
]
}
}
},
"required": [
"activityTitle"
]
}
},
"potentialAction": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"targets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"uri": {
"type": "string"
},
"os": {
"type": "string"
}
},
"required": [
"uri",
"os"
]
}
},
"@@type": {
"type": "string"
}
},
"required": [
"name",
"targets",
"@@type"
]
}
},
"themeColor": {
"type": "string"
},
"@@context": {
"type": "string"
},
"@@type": {
"type": "string"
}
}
}
Post a card in chat or channel:

The JSON schema:
- {
"type": "AdaptiveCard",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"weight": "Bolder",
"text": "@{body('Parse_JSON')['sections'][0]['activityTitle']}",
"wrap": true
}
],
"width": "stretch"
}
]
},
{
"type": "TextBlock",
"text": "@{body('Parse_JSON')['sections'][0]['activityText']}",
"wrap": true
},
{
"type": "TextBlock",
"weight": "Bolder",
"text": "@{body('Parse_JSON')['sections'][1]['activityTitle']}",
"wrap": true
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"weight": "Bolder",
"text": "@{body('Parse_JSON')['sections'][1]['facts'][0]['name']}",
"wrap": true
}
],
"width": "auto"
},
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "RichTextBlock",
"horizontalAlignment": "Right",
"inlines": [
{
"type": "TextRun",
"text": "@{body('Parse_JSON')['sections'][1]['facts'][0]['value']}"
}
]
}
],
"verticalContentAlignment": "Center"
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"weight": "Bolder",
"text": "@{body('Parse_JSON')['sections'][1]['facts'][1]['name']}",
"wrap": true
}
],
"width": "auto"
},
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "RichTextBlock",
"horizontalAlignment": "Right",
"inlines": [
{
"type": "TextRun",
"text": "@{body('Parse_JSON')['sections'][1]['facts'][1]['value']}"
}
]
}
],
"verticalContentAlignment": "Center"
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"weight": "Bolder",
"text": "@{body('Parse_JSON')['sections'][1]['facts'][2]['name']}",
"wrap": true
}
],
"width": "auto"
},
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "RichTextBlock",
"horizontalAlignment": "Right",
"inlines": [
{
"type": "TextRun",
"text": "@{body('Parse_JSON')['sections'][1]['facts'][2]['value']}"
}
]
}
],
"verticalContentAlignment": "Center"
}
]
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "@{body('Parse_JSON')['potentialAction'][0]['name']}",
"url": "@{body('Parse_JSON')['potentialAction'][0]['targets'][0]['uri']}"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.6"
}
And the Automation in Jira for good measure:

I'm not sure what else to do, as it appears the information needed just isn't being sent through?
Thanks for any help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.