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 / variable is multiple l...
Power Automate
Answered

variable is multiple line but I want it as one long line

(0) ShareShare
ReportReport
Posted on by 8

I'm need the flow to run CMD command base on previous variables but the commend gets split to 3 lines so it doesn't work.

I tried first making a variable of the commend and the run it, but it still splits to 3 lines.

 

the variable:

SET commend TO $'''veyon-cli networkobjects add computer \"%Name%\" \"%FileContents[0]%\" \"%MAC%\" \"%Lab%\"'''

 

the output:

veyon-cli networkobjects add computer "01
" "Lab08-pc01" "C0-18-03-68-89-0B
" "8"

output.png
variable.png
I have the same question (0)
  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Seems like your variables have newlines at the end.

    You can try using Trim text on %Name% and %FileContents[0]% before putting them together.

    Alternatively, you can use Replace text on %commend% after you have set it. You will need to enable regular expressions in Replace text to replace \n (which stands for newline) with %''% (this will replace it with nothing).

    Finally, you could also use Split text to split it by newline as the delimiter, and then Join list on the output of Split text to join it again, using no delimiter.

    Any of these ways are perfectly valid and should fix your problem. I'd go with trimming the variables first.

    -------------------------------------------------------------------------
    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.

  • Shimi_th Profile Picture
    8 on at

    I needed to do the trim for %MAC% as well, but it worked! thank you!

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 282 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 159 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 146 Super User 2026 Season 2

Last 30 days Overall leaderboard