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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Python script run: Syn...
Power Automate
Answered

Python script run: Syntax error.

(0) ShareShare
ReportReport
Posted on 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: 
 
I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    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!

     
  • Suggested answer
    eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at
    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.

  • rifij Profile Picture
    17 on at
    @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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard