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 input shows [...
Power Automate
Unanswered

Variable input shows [object Object] instead of string (how to convert to string?)

(0) ShareShare
ReportReport
Posted on by 17
Hi, I’m using Power Automate Desktop and facing an issue with input/output variables.  
When I use an input variable, it is always interpreted as [object Object] instead of a string,  
which makes it hard to handle the value directly as text.
 
Example:
  var val = ${MyInputVariable}
  → Output: [object Object]
 
But if I hardcode it:
  var val = "MyInputVariable"
   → Output: "MyInputVariable"
 
What I need is to treat the input variable as a simple string value (e.g., "Sentence").  
How can I properly convert or handle input/output variables in Power Automate Desktop so that they are recognized as strings instead of objects?
 
 
Thanks in advance!
 
I have the same question (3)
  • Inogic Profile Picture
    1,265 Moderator on at
    Hi,
     
    In power automate desktop the issue of [object Object] occurs because PAD variables can have different types such as Text, Number, List, Dictionary or Object. When we pass an object type variable into a script, JavaScript tries to convert it to a string, which results in [object Object]. This does not happen for the hardcoded string.

    To resolve this issue, the variable must first be ensured as a Text type in PAD. We can do this using Convert variable action or by explicitly extracting the text property from an object. 

    For example, if your variable is a dictionary or JSON object, you can access the property you need like ${MyInputVariable["PropertyName"]}. If it’s a list or array, you can get a specific item using an index, e.g., ${MyInputVariable[0]}.

    If we want entire object as a string, we can convert using JSON.stringify(${MyInputVariable}) in JavaScript action. 
    Following this approach ensures that your input/output variables are recognized as strings and can be used directly in scripts or text actions without showing [object Object].
     
    Thanks!
     
    Inogic

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

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard