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 givi...
Power Automate
Answered

Python script not giving an output

(0) ShareShare
ReportReport
Posted on by 2

Using the python script below, I'm trying to just increase the dep count by 1 but ignore the section ID. When I test this code elsewhere, it works great. However, when I run it in PAD the PythonScriptOutput doesn't change and stays as an empty string.

 

Any help would be greatly appreciated.

Capture.PNG

I have the same question (0)
  • PhilipTreacy Profile Picture
    120 on at

    Hi @Hyproxious 

     

    To access a PAD variable you need to wrap it in 3 x double quotes e.g.

     

    SO = """%SO%"""

     

    Also the print function requires () e.g. print(x)

     

    regards

     

    Phil

  • Verified answer
    PhilipTreacy Profile Picture
    120 on at

    Hi @Hyproxious 

     

    Further to this, the PAD vars are brought into Python as strings so you need to cast N to int.

     

    The following code works for me

    SO = """%SO%"""
    N = int("""%N%""")
    x = SO.split(str(N), 1)
    N += 1
    x.insert(1,str(N))
    P = ''.join(x)
    print (P)

     

    regards

     

    Phil

  • VJR Profile Picture
    7,635 on at

    Hyproxious, 

    Fully agreed with all instructions from Phil.

    One amendment is you can use a double quote on both sides to access PAD variables.

     

    Eg;  x = "%SO%"

     

    VJR_0-1658896500479.png

     

    Output of x shows up in the PythonScriptOutput variable

     

    VJR_1-1658896537261.png

     

     

     

  • imlashari Profile Picture
    3 on at

    Thanks a lot Philips. I had been searching extensively on web on how to reference PAD variable in Python script. I was using without quotes and getting error.

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
David_MA Profile Picture

David_MA 238 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 225

#3
Haque Profile Picture

Haque 181

Last 30 days Overall leaderboard