Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Governance and Administ...
Unanswered

Error using Environment variable for SharePoint library in Cloud Flow

(1) ShareShare
ReportReport
Posted on by 96

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):

Rydman_0-1650377442602.png

 

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:

Rydman_1-1650377442605.png

 

 

Rydman_2-1650377442614.png

 

 

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":

 

Rydman_3-1650377442619.png

 

 

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:

Rydman_4-1650377442625.png

 

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.

 

  • Rydman Profile Picture
    96 on at
    Re: Error using Environment variable for SharePoint library in Cloud Flow

    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!

  • MuraliCh Profile Picture
    2 on at
    Re: Error using Environment variable for SharePoint library in Cloud Flow

    @Rydman did you get the solution for this?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Governance and Administering

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 15 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 9

#3
bscarlavai33 Profile Picture

bscarlavai33 5 Super User 2025 Season 1

Overall leaderboard

Featured topics