I have a Cloud Flow that does a bunch of things, among which is to copy a set of SharePoint folders in a specific library (Baseload Document Library in the following) and then copy whatever files it finds in the source library to the target library.
I need to be able to move the solution between environments (both in our own tenant and eventually in a customer’s), so the target site will change. For this purpose, I’ve added two Environment variables, one for the site and one for the library. This is how I use them in the flow (both the Site and the Library env variable names start with the same characters but they are different):
This works as expected in my dev environment. Folders are created and files are copied into my Dev SharePoint site.
I then export/import a managed Solution to my Test env and change the environment variable values in the Default Solution:
The fact that my Doc Library appears in the dropdown list when the Site is designated by my other env variable would seem promising…
When I run my flow, the folders get created in my Test SharePoint environment which, as far as I can understand, indicates that my two env. variables work correctly. However, when I get to the Copy file bit, I get an error (i.e. the same config works in Dev but not in Test). The error is indicated as "Action 'Apply_to_each_file' failed":
I’d expect the Library string (which has its symbolic name in the File To Copy field but it’s GUID in the Destination Folder) to be identical in both fields, but it’s not.
Here’s the config for the Copy File:
I’ve had problems in the past with the exact composition of the path strings, but, since it works in Dev, that does not seem to be the issue.
Any help is greatly appreciated.
Hi,
So long ago...but I'm sure I found a way. In general, dynamically managing connector strings using Environment variables is a nightmare. With the new designer experience, one trick is to configure your connectors using the provided drop-downs, then go look in the Code View. Then at least you see all the dirty details of how the raw strings need to be formatted. Sometimes you get nasty suprises. The Excel connector, for example, expects an arcane id, only retrievable by submitting a HTTP request to the SharePoint API. Nasty. Thank god for the internet!
@Rydman did you get the solution for this?
Michael E. Gernaey
15
Super User 2025 Season 1
stampcoin
9
bscarlavai33
5
Super User 2025 Season 1