cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AaronRichardson
Resolver I
Resolver I

Escape Curly Bracket in Expression

tl;dr Is it possible to escape curly brackets ({}) when doing string manipulation in expressions?

 

I'm trying to build an HTTP request on the fly with dynamic fields and need to append curly brackets to the string, but flow throws an error saying that it's an invalid expression. I'm assuming flow's trying to compile and getting confused by the curly brackets, so I'm wondering if there's a way to escape them?

1 ACCEPTED SOLUTION

Accepted Solutions

The expression is on an append to string variable action. I solved the issue by putting each bit of the string into a concat function instead of building out the string in the String input of the action.

View solution in original post

4 REPLIES 4
Jcook
Super User
Super User

Hi @AaronRichardson 

 

Where are you getting this error?

What and where is this expression being used?


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





The expression is on an append to string variable action. I solved the issue by putting each bit of the string into a concat function instead of building out the string in the String input of the action.

View solution in original post

mariolonghi1
New Member

I could get this to work with the following syntax.

 

What I was trying to get an expression that would go like this:

 

body('GetFile').Created

 

But the property I'm interested in is actually {Path} 

So, this wouldn't work - Power Automate says it's invalid:

 

body('GetFile').{Path}

 

 

But this syntax works --- note that you need to use single quotes:

 

body('GetFile')['{Path}']

 

 

Thanks so much, @mariolonghi1 !!!

I thought I had looked everywhere and tried everything and was about to give up....but I KNEW if the SharePoint API output had attributes with curly brackets in the name, there had to be a way to do it.  I'd have never figured out if I hadn't finally found your tip.  Thanks!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (3,025)