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 / Application Command Li...
Power Automate
Answered

Application Command Line Argument

(0) ShareShare
ReportReport
Posted on by 8

Hi everyone

 

In my script I run an application launching my VPN.

In the command line argument, I currently have CONNECT in place, which successfully launches the VPN.

 

However I would like the script to randomly choose between a series of predefined text commands, specifically locations.

For example CONNECT UNITED KINGDON, CONNECT FRANCE etc.

 

What is the best way to create a dynamic input for the command line argument? I tried creating list etc, doesnt seem to work

 

Thanks much

I have the same question (0)
  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    I would:

     

    Create List (add all locations to the list) to %Locations%
    Set random whole number between 0 and %Locations.Count - 1% to %Rand%
    Then, where you need it in your command line, use %Locations[Rand]% to pull the random location. 

    If that doesn’t work, then do the same logic in Excel, have one cell be the random number and the cell next to it being a vlookup formula.  Then you can read the value from the vlookup cell. 

    good luck!

     

  • mamouth Profile Picture
    8 on at

    Thanks for the prompt answer @MichaelAnnis 

    for some reason, the command doesnt run when the input is not just plain text. i.e. the minute the input is coming from a list it's a no go, even if i only put one 'Connect' argument in the list of testing sake..

     

    i'll spend more time on it tomorrow

    Thanks

  • VJR Profile Picture
    7,635 on at

    @mamouth, once you get it from the list try by using the Trim text action which will typecast it to a text format as well as remove any unwanted characters if there may be any at the start or end.

     

    Hope you are taking care of adding a space between the CONNECT and the location name.

  • mamouth Profile Picture
    8 on at

    Thanks @VJR and @MichaelAnnis 

    Ultimately I used a combination of both solutions - Using the rand function in excel + vlookup for generate a random input for the command line.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 784

#2
Valantis Profile Picture

Valantis 581

#3
Haque Profile Picture

Haque 545

Last 30 days Overall leaderboard