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 / Problems with passing ...
Power Automate
Answered

Problems with passing numerical variables to powershell

(0) ShareShare
ReportReport
Posted on by 26

I create a variable in power automate desktop with the name "MyVariable1" and with the value 380.7 and then I want to collect that variable inside a powershell code that I have inside power automate desktop and I use the following instruction inside powershell to do so:

 

$MyVariable2 = '%MyVariable1%'

 

And $MyVariable2 is the one that I use inside powershell to send that number to a position X and the movement that makes me is not correct it moves much more to the right of what it would move if I put the number 380.7 manually without variable.

 

I think that two things can happen:

 

1. I have not correctly moved the variable from power automate desktop to powershell.

 

2. To power automate desktop I put the value 380.7 (with dot) but it converts it to 380.7 (with comma) because it uses the decimals with commas instead of with dots maybe it converts it to comma and when I pass it to powershell it doesn't recognize it well.

 

Does anyone know if it is really one of these two options and could be something else the problem?

 

Thank you very much for your time!

I have the same question (0)
  • Verified answer
    UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    please convert your variable into number

    by using convert number into text activity

    then try

     

    Hope this helps

    Usha

  • speedhb90 Profile Picture
    26 on at

    Excuse me, could you give me an example of how to do it? Thanks!

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @speedhb90 

     

    Try this simmilar approach 

     

    Nived_Nambiar_0-1705424757627.png

     

    Here i am doing addition operation b/w a number passed as variable from PAD and number within powershell, as you see there is no single quotes for MyVariable , so just give a try like that 🙂

     

    I also assume MyVariable is of numerical datatype 🙂

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • speedhb90 Profile Picture
    26 on at

    I have already done it and it worked. Thank you very much!

  • speedhb90 Profile Picture
    26 on at

    Thank you very much!

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    did that approch worked for you ?

     

  • speedhb90 Profile Picture
    26 on at

    I had a problem, which I have explained in another thread

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 259 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 177 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 136 Super User 2026 Season 2

Last 30 days Overall leaderboard