cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CoryC
Frequent Visitor

Bad Request Caused by Bracket Symbol

Hello, I've been trying to parse some multiple choice Forms response into something an adaptive card can read and noticed that, in my test run, it looks like the Join action I used caused the output to pop out something like this: 

 

"text": "Reasons for Termination: ["Temporary Layoff -- Subject to Recall","Health Reasons (Explain)"]"

 

On top of the extra " causing it to think that was the end of the string, I also noticed the brackets that are there. Now I"m new to using expression based functions so I was wondering what would be the best approach to filter out these extra characters so it can read all of this right.

1 ACCEPTED SOLUTION

Accepted Solutions
DamoBird365
Community Champion
Community Champion

Hi @CoryC 

 

If it is just this one string, you could use replace.  replace(stringvalue,'"','') i.e. replace " with nothing.  Then do the same for [ and ].  You can embed replace expressions.

 

Alternatively, where is this string coming from ?  Is it JSON / Array.  Maybe we could build an alternative expression if you supply an example?

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

2 REPLIES 2
DamoBird365
Community Champion
Community Champion

Hi @CoryC 

 

If it is just this one string, you could use replace.  replace(stringvalue,'"','') i.e. replace " with nothing.  Then do the same for [ and ].  You can embed replace expressions.

 

Alternatively, where is this string coming from ?  Is it JSON / Array.  Maybe we could build an alternative expression if you supply an example?

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

View solution in original post

Thank you for the quick response. The string is coming from a Join action with the expression as follow: json(body('Get_response_details')?['r4a11bb2fe2c0498ba6a774a83fc03c44'])

 

If it helps any, the JSON code I was using for that particular adaptive card is this:

{
"type": "TextBlock",
"text": "Reasons for Termination: @{outputs('Get_response_details')?['body/r4a11bb2fe2c0498ba6a774a83fc03c44']}",
"wrap": true
},

 

I just put in the block that this was happening at for now, but if you need more I can supply more.

 

When you say to embed the replace function, where exactly do those go? 

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (73,704)