Forum Discussion

Brian_M's avatar
Brian_M
Icon for Continued Contributor rankContinued Contributor
9 years ago
Solved

Why does Sys.getenv("USERNAME") return empty result in Power BI?

Can someone explain why this R script is not allowed to return environment information in Power BI?   If I run it in RGui then I receive the Windows username as expected   let     source = R.Exec...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi Brian_M,

     

    I can reproduce your issue, even if I test "OS", "Path" but I still get the empty result. I also try to use "get data" from R script and get the same result.

     

     

    Can you directly use R script to get the environment variables? If you can, it may means power bi not allow use R script to get environment information.

     

    In addition, you can take a look at below article about using R script:

    Running R Scripts in Power BI Desktop 

     

    Regards,

    Xiaoxin Sheng