web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / python script not conv...
Power Automate
Answered

python script not converted file

(1) ShareShare
ReportReport
Posted on by 41

I have a python script that converts a .txt file by padding extra spaces at the end of each line.  I try the Run Python Script but it is not storing in the variable.  I run the python script outside of Power Automate Desktop and it works no issue only in PAD.

 

Patrick_Perea_0-1720208435485.png

Patrick_Perea_1-1720208456990.png

 

 

I have the same question (0)
  • Verified answer
    eetuRobo Profile Picture
    4,572 Super User 2026 Season 1 on at

    There is most likely an error happening.
    I recommend turning on ScriptError -variable in your script action:

    eetuRobo_0-1720236980874.png

    Then it should return error message and a line where the error happens. 

    When ever using any Run script action you should always turn on ScriptError in Variables produced (unless you have written error handling yourself to the script)

     

    I haven't used Python much on PAD but I many times I see people recommend running it with Run PowerShell script. So save the script as a .py file and give Run PowerShell script the path to the python script file.
    Remember to also toggle on ScriptError on the Run PowerShell script -action.

    Example thread about running it with PowerShell: https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Python-Script-in-PAD/td-p/1459182 

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @Patrick_Perea 

     

    well if you want python script output to be stored in PAD's variable - you have to use print function. Take this as an example-

    Nived_Nambiar_0-1720372026913.png

     

    See the variable in PAD shows the value of variable c 

    Nived_Nambiar_1-1720372057890.png

     

    Hope this helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 223

#2
David_MA Profile Picture

David_MA 195 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 167

Last 30 days Overall leaderboard