Forum Discussion

jaryszek's avatar
jaryszek
Super User
1 year ago
Solved

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. Fu...
  • v-aatheeque's avatar
    1 year ago

    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)

     

     

     

     

    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!