Logic Apps When a File is created or modified in sharepoint

Kevin Warren 21 Reputation points
2022-09-16T20:31:57.423+00:00

The error message says it is expecting an array in this context. Any suggestions?

242021-image.png

241950-image.png

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

Answer accepted by question author
  1. Alistair Ross 7,471 Reputation points Microsoft Employee
    2022-09-16T21:26:32.753+00:00

    Hi @Kevin Warren

    The for each statement is excepting an array to be defined in the trigger body. The likely hood is that you are referencing the entire JSON object from the trigger body with the dynamic value 'triggerBody()'. Chances are if you are wanting to loop through multiple objects within the trigger, then you'd need to reference it like 'triggerBody().AnArray'. The below examples show the syntax in JSON of an object, wrapped with braces "{ }" and arrays, with square brackets "[ ]".

    "body :{
    "AnArray: ["A","B",C"]
    }

    If there isn't multiple objects, then simple do not use the foreach loop. If this still doesn't make sense, share the output of the trigger "when a file is created or modified in a folder".

    kind regards

    Alistair


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.