Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
jaryszek
Super User
Super User

Power Query Formula firewall when refering to dynamic folder - avoiding to change privacy settings

Hi Guys,

i have the code like here to create a string query called: Bundles_Path

= fnGetPath("BUNDLES_PATH_TEST")


- this is my function with argument refrencing to windows environment.

Function is:

let
    GetPath = (envVariable as text) =>
    let
        Source = Python.Execute("
import os
import pandas as pd

env_value = os.getenv('" & envVariable & "')

data = [[env_value]]
df = pd.DataFrame(data, columns=['Path'])
"),
        df1 = Source{[Name="df"]}[Value],
        Path = df1{0}[Path]
    in
        Path
in
    GetPath

 

It is working and I am getting String as path.
Now when I am refering to folder as created string query and creating new query "Derived":

= Folder.Files(Bundles_Path)

I am getting :
Formula.Firewall: Query 'Derived' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.

How to avoid this error?Putting this value into parameter will solve it?

Best,
Jacek

1 ACCEPTED SOLUTION
v-aatheeque
Community Support
Community Support

Hi @jaryszek ,
Thanks for reaching out to Microsoft Fabric Community Forum.
@lbendlin Thanks for your prompt response. In addition to that :
Yes, you can create a parameter to pass the path to the code as below.

function :

let
    GetPath = (envVariable as text) =>
    let
        Source = Python.Execute("
import os
import pandas as pd
 
env_value = os.getenv('" & envVariable & "')
 
data = [[env_value]]
df = pd.DataFrame(data, columns=['Path'])
"),
        df1 = Source{[Name="df"]}[Value],
        Path = df1{0}[Path]
    in
        Path
in
    GetPath= Folder.Files(BUNDLES_PATH_TEST)

 

 

vaatheeque_1-1742797228961.jpeg

 

 

Using Folder.Files(BUNDLES_PATH_TEST) function will help in fetching the information from above path.

If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.

If you continue to face issues, feel free to reach out to us for further assistance!

 

 

 

View solution in original post

2 REPLIES 2
v-aatheeque
Community Support
Community Support

Hi @jaryszek ,
Thanks for reaching out to Microsoft Fabric Community Forum.
@lbendlin Thanks for your prompt response. In addition to that :
Yes, you can create a parameter to pass the path to the code as below.

function :

let
    GetPath = (envVariable as text) =>
    let
        Source = Python.Execute("
import os
import pandas as pd
 
env_value = os.getenv('" & envVariable & "')
 
data = [[env_value]]
df = pd.DataFrame(data, columns=['Path'])
"),
        df1 = Source{[Name="df"]}[Value],
        Path = df1{0}[Path]
    in
        Path
in
    GetPath= Folder.Files(BUNDLES_PATH_TEST)

 

 

vaatheeque_1-1742797228961.jpeg

 

 

Using Folder.Files(BUNDLES_PATH_TEST) function will help in fetching the information from above path.

If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.

If you continue to face issues, feel free to reach out to us for further assistance!

 

 

 

lbendlin
Super User
Super User

inline your function to keep everything in the same partition.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.