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

Community site session details

Session Id : w5TN1aIr3CllBAAiudpqUG
Power Automate - Power Automate Desktop
Answered

PAD - Pass variable to Vbscript

Like (0) ShareShare
ReportReport
Posted on 10 Jan 2024 14:56:29 by 8

Hello, 

 

Here is the two line of code in vbscript. The userInput is text variable in PAD which has been passed to vbscript. 

 

id = %UserInput%
WScript.Echo id

 

It is getting this error when executing: 

(1, 6) Microsoft VBScript compilation error: Syntax error

I have the same question (0)
  • CristinaValdes Profile Picture
    64 on 10 Jan 2024 at 15:02:30
    Re: PAD - Pass variable to Vbscript


    Hello,

    You may have the % symbol, only for one variable you use %Yourvariable%, but if your code has the % symbol you need to escape it, you must put %% for each % symbol.

    Example:

    WScript.Echo id%%espanol.%%something %Yourvariable%

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on 10 Jan 2024 at 14:58:43
    Re: PAD - Pass variable to Vbscript

    You probably need to encapsulate the variable in quotes, if it's not a numeric value.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 854 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 525 Moderator

#3
trice602 Profile Picture

trice602 318 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading started
Loading complete