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 / Execute SQL Statement ...
Power Automate
Answered

Execute SQL Statement with python variable

(0) ShareShare
ReportReport
Posted on by 5

I've follow this forum post "https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Week-number-in-pad/td-p/1248365" to use the PAD "Run Python Script" option to generate a python variable to show the current weeks number. This works great and I get the data that I'm expecting when I use display message. But when I attempt to execute a SQL statement with ('%PythonScriptOutput%';) I get no results. If I replace the variable with an actual number the statement works fine. I've been able to pass other variables via PAD in other statements just not working with the Python script. I'm able to use "Set variable" to 24 and that newvar variable pass through the SQL statement fine as well. Has anyone else seen this issue before or know of a workaround for this? Thank you in advance for any help with this.

  • Srini007 Profile Picture
    3,490 Super User 2026 Season 1 on at

    Hi @Fearmonger 

     

    Yeah, for me the same issue, but what I found is that the output,which it is showing has some other extra values where it is not able to convert to number also

     

    Srini84_0-1687116531881.png

     

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

     

     

     

  • Verified answer
    Srini007 Profile Picture
    3,490 Super User 2026 Season 1 on at

    Hi @CST 

     

    I don't know where to escalate this bug, can you check this is for PAD and when we get the output result from Python it is giving some other whitespaces I believe, that's where it is not converting even though cleared the white spaces

     

    Srini84_0-1687117157004.png

     

     

    OR 

     

    I misunderstood the action

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

  • Samudiho Profile Picture
    4 on at

    One possible solution would be to use this module called ‘text entity recognizer’ and then retrieve the value

    Samudiho_0-1693942699696.png

     

     

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

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 211 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 190

Last 30 days Overall leaderboard