Skip to main content

Notifications

Community site session details
Power Automate - Power Automate Desktop
Answered

Python script run: Syntax error.

Like (0) ShareShare
ReportReport
Posted on 24 Oct 2024 19:22:47 by 17
I created PAD flow that goes out to a site and essentially downloads a file after selecting certain triggers. The downloaded file then gets passed to a folder, using the automation to a dedicated output folder. From there a Python script I wrote goes to the output folder and cleans/delete unnecessary columns/items. After that is done, the script will take remaining columns and do a pivot table. Currently I'm running the Python Script (In Visual Studio Code) and the PAD flow as separate actions/items. I came across the "Run Python Script" option in PAD and have tried to use it to bridge the gap. When I paste my python script into the script area and input my module folder location I receive the following error: "Parameter 'Python script to run': Syntax error." Error persist whether i update the python version to 2.7 or 3.4. How do i go about fixing? I've attached images of the error and the script with redacted folders & other info: 
 
  • rifij Profile Picture
    17 on 25 Oct 2024 at 18:27:12
    Python script run: Syntax error.
    @eetuRobo thank you and both suggestions work beautifully. I decided to go with the PowerShell and even inside of it I needed to add the additional % (percent sign) in order to avoid the syntax error. Without the additional % sign, syntax error shows. Very much appreciated.
  • Verified answer
    eetuRobo Profile Picture
    3,273 Super User 2025 Season 1 on 25 Oct 2024 at 04:41:21
    Python script run: Syntax error.
    PAD doesn't like when there is % sings since it thinks that starts a variable. After every % sign add an extra one. PAD will read that as just one percent sign.

    You could also run the python script with Power Shell if the script works on its own. So use Run PowerShell script -action to start the python script.

  • Nived_Nambiar Profile Picture
    17,570 Super User 2025 Season 1 on 25 Oct 2024 at 02:42:11
    Python script run: Syntax error.
    Hi,
     
    i doubt whether it is an indentation issue within python script which occured when copying to action 
     
    That may be the reason why syntax error is shown.
     
    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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

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

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Power Automate Desktop

#1
eetuRobo Profile Picture

eetuRobo 18 Super User 2025 Season 1

#2
Nived_Nambiar Profile Picture

Nived_Nambiar 10 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 6

Overall leaderboard
Loading started
Loading started