Hi all,
New to Power Automate. I have looked at the many questions to this on here, and none of the solutions seem to work for me. All I'm trying to achieve is to save files (.csv) in a SharePoint folder to different folders within SharePoint based on their filename. See the attached images for the flow and values below.
Errors:
The variable 'FolderPaths' of type 'Array' cannot be initialized or updated with value of type 'Object'. The variable 'FolderPaths' only supports values of types 'Array'.
BadRequest. The variable 'FolderPaths' of type 'Array' cannot be initialized or updated with value of type 'Object'. The variable 'FolderPaths' only supports values of types 'Array'.
ActionConditionFailed. The execution of template action 'Filter_array' is skipped: the 'runAfter' condition for action 'Initialize_variable' is not satisfied. Expected status values 'Succeeded' and actual value 'Failed'.
Here is what I have put into the different actions.
Initialize variable
{
"AKL": "/attachments/AKL",
"BSS": "/attachments/BSS",
"PCA": "/attachments/PCA"
}
Filter array
endsWith(triggerBody()?['{Name}'], '.csv')
Apply to each
outputs('Filter_array')?['body']
Compose
last(split(item()?['{Path}'], '/'))
Compose
variables('FolderPaths')[outputs('Compose')?['result']]
Open to any other ways of doing that will be easier.