Hi all,
Currently, I am trying to automate getting a file from the latest folder in Sharepoint Library. So far, I am able to get the Name and Path of the latest folder but it is the subsequent steps that I have trouble with.
1. Get files (properties only)
2a. Select operation --> outcome: gets latest folder in library.
Map:
Name: item()?Name
Path: item()?Path
b. initialise varArr with String values.
3. Compose outcome. inputs: first(body('Select')?['Name'])
as the first record is the latest folder
4. Filter array
From varArr
item() is equals to outputs('Compose')
5. Condition
length(body('Filter_array')) is equals to 1 // folder name should only match with one element in the arr
If anyone can spot my mistake, please do advise on what I should change. Thank you
Hi @Anonymous,
Can you double check or share screenshots of the outputs of the Select, Initialize variable and Compose actions of your flow run?
The comparison would be case sensitive. Make sure there is not a different casing in values and they are exactly the same.
Hi @Expiscornovus ,
Thanks for your response. I have tried out what you have suggested and my condition output is still false. I have a feeling there might be something wrong with step 2. When the Filter array operation is executed, the output is an empty array. I am not too sure what is the issue with it. 😔
Hi @Anonymous,
I think the closing parentheses of the first function is in the wrong location. Can you try this expression instead in the Compose?
first(body('Select'))['Name']
The rest looks alright. I tested with the below config in my dev environment.
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional