Hello,
I have a flow that checks if a file has been through the approval process or not (a different flow) by looking at its name and by comparing it to a value in a sharepoint list that's generated from the other flow mentioned and if it has been move it to its appropriate folder based on response from an email. I have two questions with this flow at the moment, one I've been actively trying to fix and the other I haven't spent as much time on.
1. Equals Expression
I have a condition (shown below) that I would like to check the name of the file thats being checked (the when a file is created (properties only) trigger) contains the '.Approved', which is what I have in the condition at the moment so that way it works when I test the flow since the other part isn't working. Along with this, I want the condition to check that the Approved column in the Sharepoint List for that item has the value yes (true when it's imported into the flow). This is where I'm struggling.
equals(body('Get_items')?['Approved'],'true')
This is the equation I'm using at the moment but every time I run it, it returns false. It should return true but its not and I'm not sure what I'm doing wrong. I'm writing the word true exactly how it gets outputted from the Get Items action as shown below. Any thoughts?
In the end, I'd like to do an and expression to combine them together but until I get this part, I can't.
2. When I'm moving the file into its new folder, a subfolder of the one its in, it loses it's content even though the file content is being used. I've also noticed that it loses its type (ex. excel). Is there a way around this? I know subfolders isn't fully supported on Flow yet but is possible.
Overall Flow
Get Items Body Output
Condition
File in Main Folder
File in Subfolder
Thanks,
leanns
Solved! Go to Solution.
Hi @leanns,
Could you please share a bit more about the Approved column within your SharePoint List? Is it a Yes/No type column?
I suppose that the Approved column within your SP list is a Yes/No type column, is it true?
If the Approved column is a Yes/No type column in within your SP list, I think there is something wrong with the Equals Expression that you provided. Please take a try to modify your Equals Expression as below to check if the issue is solved:
equals(body('Get_items')?['Approved'],true)
Note: The true is a Boolean value rather than a string. The true is not wrapped with single quotes.
For your second question, could you please share a bit more about the replace() expression within the File Name field of the "Create file" action?
I think there is something wrong with the formula that you provided within the File Name field of the "Create file" action. Please check if the result the replace() expression returned contains the file name extension, if not, please append the file name extension into the replace() expression. Please check and see if the following thread would help in your scenario:
More detais about creating a file within a new created subfolder folder, please check the following thread:
Best regards,
Kris
Hi @leanns,
Could you please share a bit more about the Approved column within your SharePoint List? Is it a Yes/No type column?
I suppose that the Approved column within your SP list is a Yes/No type column, is it true?
If the Approved column is a Yes/No type column in within your SP list, I think there is something wrong with the Equals Expression that you provided. Please take a try to modify your Equals Expression as below to check if the issue is solved:
equals(body('Get_items')?['Approved'],true)
Note: The true is a Boolean value rather than a string. The true is not wrapped with single quotes.
For your second question, could you please share a bit more about the replace() expression within the File Name field of the "Create file" action?
I think there is something wrong with the formula that you provided within the File Name field of the "Create file" action. Please check if the result the replace() expression returned contains the file name extension, if not, please append the file name extension into the replace() expression. Please check and see if the following thread would help in your scenario:
More detais about creating a file within a new created subfolder folder, please check the following thread:
Best regards,
Kris
Thank you for the suggestions. They fixed my problems mentioned above. I appreciate the help. I did have to do a work around since I couldn't pull the Approved token from the Get Items actions by using some compose statements and a variable. But the equation works, I just had to grab the token in a different way.
I have marked your reply as my solution.
Thank you again,
leanns
Hello, as I am trying to combine my equals expression and Name check expression together I keep getting an error. I was wondering if you could take a look and see what little thing I'm missing because they work separately but not together.
contains(triggerBody()?['Name'],'__Approved')
*the __ is a double underscore
equals(outputs('Compose_2'),true)
I've tried combining them with the and expression and the if expression but I keep getting this error:
Here's a picture of the flow that I'm trying to fix:
Thanks again,
leanns
Nevermind I figured it out. I just needed to retype in the expressions. The syntax wasn't correct for the triggerBody() expression.
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
50 | |
41 | |
39 | |
36 | |
34 |
User | Count |
---|---|
68 | |
67 | |
65 | |
54 | |
49 |