Skip to main content

Notifications

Power Automate - Power Automate Desktop
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: 
 
  • rifij Profile Picture
    rifij 17 on at
    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
    eetuRobo 2,682 on at
    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
    Nived_Nambiar 17,024 on at
    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard