Hello,
I'm building a simple flow,
First, the requestor fill the Forms and upload attachment;
Second, store the attachment in an array and send to approvers;
Third, if all approvers approve, create record in SharePoint, including the attachment.
my flow looks like this:
So far, everything is OK, except for the last scope: create SharePoint record:
what I'm trying to do in this scope is :
1. create a record in a SharePoint list (already done and OK);
2. create a new folder in SharePoint with the name: Requestor's name + department name + submission date;
3. store the attachments that requestor upload to the Forms to the newly created SharePoint folder (the attachments are already stored in array in my flow).
Appreciate any help in this, Thanks in advance!
Solved! Go to Solution.
Yes, I have solved the issue, in an old way...
I use the same method that I used to append to the attachment array variable:
First, get file content using path (OneDrive for business)
Second, create file (SharePoint)
Third, put the above in an Apply to each:
and it worked... in this old way...
I think the issue with using the attachment array variable is the wrong folder path I type in with Create file in SharePoint, I insert an "forms" in the folder path...
Thank you!
Hi!
I am assuming you assigned a value to 'Create a new folder' 'Folder path' input... if so, can you share which WDL expression, or value are you currently assigning?
If so, I believe 'Create a new folder' execution is currently failing, right?
Can you share a screenshot of your last flow execution, so we can see details of the error and also the Folder name you are trying to add?
Thanx!
Proud to be a Flownaut!
@efialttes This is the expression I used:
concat(outputs('Get_user_profile_(V2)')?['body/displayName'],outputs('Get_response_details')?['body/r5b183a83ba534d0e94fa4a61fabaef99'],outputs('Get_response_details')?['body/submitDate'])
and this is the error message:
@efialttes I know what's the issue now, the time stamp that I'm trying to add into the folder name has "/" in it, after I delete the time stamp the flow works and folder created.
Now only one issue remain: store the attachments to the newly created SharePoint folder.
How can I do that? I already has an array variable that stores all the uploaded attachments, any idea which function I should use for this? Can you help me on it?
Hi!
I would use 'Apply to each' action block, assign as its input the attachments array.
THis blocks iterates all through your array elements and execute its internal logic N times (being N the nr of elements on your array)
Now inside 'Apply to each' I would add SP 'Create file' action block
Hope this helps
Proud to be a Flownaut!
@efialttes I took your advice and built this:
For the File name I use the expression: name(variables('varAttachment') ;
For the File content I use the expression: Content(variables('varAttachment')
I'm absolutely sure that my expression is wrong, and it returns error like this:
BTW, this is how I define my variable for attachment:
Can you help me with this?
Thank you!
Hi!
We are closer to a happy ending...
"...For the File name I use the expression: name(variables('varAttachment') ;
For the File content I use the expression: Content(variables('varAttachment')..."
Since you are inside an Apply to each iterating all through your attachments array whose elements are objects with two attributes ('Name' and 'Content'), I wuold use the following WDL expressions instead:
item()?['Name']
item()?['Content']
Hope this saves your day
Proud to be a Flownaut!
Yes, just one more step,
I tried the following :
item(variables('varAttachment'))?['name'];
item(variables('varAttachment'))?['Content']
and
item()?['Name']
item()?['Content']
Both times the flow run successfully but no files added to folder, not sure what the issue is, maybe the expression again, I'm kind of newbie so I don't really know how to make expression...
Hi again!
"Both times the flow run successfully but no files added to folder"
So we are closer to a happy ending, right? I mean, in your first post Flow crashed. Now it succeed, even though its result is not the expected one.
Now, on your new problem: no files are added to the folder.
You are my eyes here. You know which changes you added to the last flow design you shared, and if needed, share a new screenshot from your flow design.
You can also inspect the flow execution and figure out how many times the first 'Apply to each' is executed, so this way we can figure out if the array is empty or not. And, you can figure out how many times the second 'Apply to each' (the one with the 'Create file' action block inside) is executed also. If not sure how to figure out it, you can also share a screenshot from your flow execution
THe more valuable feedback you can provide the faster you will get a good insight
Thanx!
Proud to be a Flownaut!
Did you finally solve the issue?
Thanx!
Proud to be a Flownaut!
Yes, I have solved the issue, in an old way...
I use the same method that I used to append to the attachment array variable:
First, get file content using path (OneDrive for business)
Second, create file (SharePoint)
Third, put the above in an Apply to each:
and it worked... in this old way...
I think the issue with using the attachment array variable is the wrong folder path I type in with Create file in SharePoint, I insert an "forms" in the folder path...
Thank you!
I tried the following
item(variables('varAttachment'))?['Content']
item(variables('varAttachment'))?['Name']
it returns an error
and this is how I built the flow:
Thanx for sharing, @Derek4 !
Contributions like yours make this community great!
Proud to be a Flownaut!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
68 | |
23 | |
18 | |
16 | |
12 |
User | Count |
---|---|
137 | |
44 | |
32 | |
32 | |
29 |