web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Power Up Program Community
Unanswered

Invalid Expression Notification in Condition

(0) ShareShare
ReportReport
Posted on by 2
Hi all,
 
I'm trying to automate an approval process from a sharepoint list. I've tried a million different ways already to fix this issue (tried formulas, changing the dynamic content, checked my list for spelling/characters/space issues) and nothing is working.
 
I'v pasted the code below and attached a picture. Any help is greatly appreciated!
 
 
{
  "type": "If",
  "expression": {
    "and": [
      {
        "equals": [
          "@triggerBody()?['Status']",
          "Under Review"
        ]
      }
    ]
  },
  "actions": {
    "Start_and_wait_for_an_approval": {
      "type": "OpenApiConnectionWebhook",
      "inputs": {
        "parameters": {
          "approvalType": "BasicAwaitAll",
          "WebhookApprovalCreationInput/title": "Approve SOP: @{trigger0utputs()?['body/DocumentName']}",
          "WebhookApprovalCreationInput/assignedTo": "jenelle.champlin@monogramhealth.com;antonio.forbes@monogramhealth.com",
          "WebhookApprovalCreationInput/details": "Please review the following document within 72 hrs:\n\nDocument Name: @{trigger0outputs()?['body/DocumentName']}\nType: @{trigger0utputs()?['body/DocumentType]}\nLink: @{trigger0utputs()?['body/Link_x0020_to_x0020_Document']}",
          "WebhookApprovalCreationInput/enableNotifications": true,
          "WebhookApprovalCreationInput/enableReassignment": true
        },
        "host": {
          "apiId": "/providers/Microsoft.PowerApps/apis/shared_approvals",
          "connection": "shared_approvals",
          "operationId": "StartAndWaitForAnApproval"
        }
      }
    },
    "Condition_1": {
      "type": "If",
      "expression": {
        "and": [
          {
            "equals": [
              "@outputs('Start_and_wait_for_an_approval')?['body/outcome']",
              "Approve"
            ]
          }
        ]
      },
      "actions": {
        "Update_item": {
          "type": "OpenApiConnection",
          "inputs": {
            "parameters": {
              "dataset": "https://monogramhealthcare.sharepoint.com/sites/MemberServices-LeadershipHub",
              "table": "242fcf2e-c941-4188-a59a-3ffe556e5f34",
              "id": "@triggerBody()?['ID']",
              "item/Title": "@outputs('Start_and_wait_for_an_approval')?['body/title']",
              "item/Status/Value": "Approved",
              "item/ApprovalDate": "@utcNow()"
            },
            "host": {
              "apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
              "connection": "shared_sharepointonline",
              "operationId": "PatchItem"
            }
          }
        },
        "Post_message_in_a_chat_or_channel": {
          "type": "OpenApiConnection",
          "inputs": {
            "parameters": {
              "poster": "Flow bot",
              "location": "Chat with Flow bot",
              "body/recipient": "elyssa.duran@monogramhealth.com",
              "body/messageBody": "<p class=\"editor-paragraph\">SOP Approved:</p><br><p class=\"editor-paragraph\">@{DocumentName}</p><p class=\"editor-paragraph\">Approved by: @{Reviewer} on @{utcNow()}</p>"
            },
            "host": {
              "apiId": "/providers/Microsoft.PowerApps/apis/shared_teams",
              "connection": "shared_teams",
              "operationId": "PostMessageToConversation"
            }
          },
          "runAfter": {
            "Update_item": [
              "SUCCEEDED"
            ]
          }
        }
      },
      "else": {
        "actions": {
          "Update_item_1": {
            "type": "OpenApiConnection",
            "inputs": {
              "parameters": {
                "dataset": "https://monogramhealthcare.sharepoint.com/sites/MemberServices-LeadershipHub",
                "table": "242fcf2e-c941-4188-a59a-3ffe556e5f34",
                "id": "@triggerBody()?['ID']",
                "item/Status/Value": "Needs Changes"
              },
              "host": {
                "apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
                "connection": "shared_sharepointonline",
                "operationId": "PatchItem"
              }
            }
          },
          "Post_message_in_a_chat_or_channel_1": {
            "type": "OpenApiConnection",
            "inputs": {
              "parameters": {
                "poster": "Flow bot",
                "location": "Chat with Flow bot",
                "body/recipient": "elyssa.duran@monogramhealth.com",
                "body/messageBody": "<p class=\"editor-paragraph\">The following document was not approved:</p><br><p class=\"editor-paragraph\">@{DocumentName}</p><p class=\"editor-paragraph\">@{Outcome}</p><p class=\"editor-paragraph\">@{Reviewer}</p><p class=\"editor-paragraph\">@{Notes}</p>"
              },
              "host": {
                "apiId": "/providers/Microsoft.PowerApps/apis/shared_teams",
                "connection": "shared_teams",
                "operationId": "PostMessageToConversation"
              }
            },
            "runAfter": {
              "Update_item_1": [
                "SUCCEEDED"
              ]
            }
          }
        }
      },
      "runAfter": {
        "Start_and_wait_for_an_approval": [
          "SUCCEEDED"
        ]
      }
    }
  },
  "else": {
    "actions": {}
  },
  "runAfter": {}
}
Categories:
I have the same question (0)
  • timl Profile Picture
    36,319 Super User 2025 Season 2 on at
    Invalid Expression Notification in Condition
     
    Is Status a SharePoint Choice column? If so, is there a 'Status Value' column that you can select instead of 'Status', when building your conditon?
  • ED-02122019-0 Profile Picture
    2 on at
    Invalid Expression Notification in Condition
    @timl I tried that as well. I switched from the new designer to the old one and was able to get it to work that way. Frustrating but it worked!
  • timl Profile Picture
    36,319 Super User 2025 Season 2 on at
    Invalid Expression Notification in Condition
    Thanks for the update @ED-02122019-0 - I'm glad that switching back to the old designer fixed the problem.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Microsoft Power Up Program Community

#1
timl Profile Picture

timl 448 Super User 2025 Season 2

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 127 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 99 Super User 2025 Season 2

Last 30 days Overall leaderboard