<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Remove Square brackets [] from a string of output from a!tojson</title><link>https://community.appian.com/discussions/f/user-interface/38353/remove-square-brackets-from-a-string-of-output-from-a-tojson</link><description>I was sending a data in json format like { a!tojson(&amp;quot;fruit&amp;quot;: &amp;quot;apple&amp;quot;) } but the output i was getting { &amp;quot;fruit&amp;quot;: ["apple"] }but i need without square brackets . Could anyone please help me on this and thanks for advance</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Remove Square brackets [] from a string of output from a!tojson</title><link>https://community.appian.com/thread/144918?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2025 10:25:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1b68a40a-8ca8-41be-8b54-09578de96253</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/pastedimage1738232716911v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Square brackets [] from a string</title><link>https://community.appian.com/thread/144915?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2025 09:06:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b43340c3-4fe2-4d45-a310-8cd2e930b7b3</guid><dc:creator>vemasani vishnu vardhan</dc:creator><description>&lt;p&gt;&lt;span&gt;I was sending a data in json format like { a!tojson(&amp;quot;fruit&amp;quot;: &amp;quot;apple&amp;quot;)} but the output i was getting &amp;quot;fruit&amp;quot;: ["apple"] but i need without square brackets&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Square brackets [] from a string</title><link>https://community.appian.com/thread/144525?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 16:44:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d9f9de37-b29c-4cb0-8c3d-b7c8d8895ae7</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;Yeah I think it would be helpful to provide a larger snippet of what your data looks like and tell us more about how you plan to use it. While there are a lot of functions that could probably achieve what you&amp;#39;re looking for, if it&amp;#39;s coming in JSON using a!fromJson() is usually your best bet&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Square brackets [] from a string</title><link>https://community.appian.com/thread/144519?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 15:18:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:86cb80d5-8028-4adb-80be-9bad82ef0b80</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="236461" url="~/discussions/f/user-interface/38353/remove-square-brackets-from-a-string/144511"]inside the a!tojson function[/quote]
&lt;p&gt;What do you mean by this exactly?&lt;/p&gt;
&lt;p&gt;The string &amp;quot;["12hg"]&amp;quot; (or &amp;quot;[""12hg""]&amp;quot; in escape-quoted appian expression notation) is a valid JSON string containing the value &amp;quot;12hg&amp;quot;.&amp;nbsp; Passing it through a!fromJson() results in the value you&amp;#39;re looking for.&amp;nbsp; I&amp;#39;m not sure what other complication there is here.&amp;nbsp; Your original JSON message would still be untouched, since that&amp;#39;s how Appian variables work.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/pastedimage1737386367606v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Square brackets [] from a string</title><link>https://community.appian.com/thread/144516?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 14:31:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c32e2cce-8454-4d13-b1e7-bf585ef81e41</guid><dc:creator>Anna P</dc:creator><description>&lt;p&gt;Try this&lt;/p&gt;
&lt;p&gt;a!localVariables( local!text: &amp;quot;[""12hg""]&amp;quot;, stripwith( local!text,&amp;quot;["" ""]&amp;quot;) )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Square brackets [] from a string</title><link>https://community.appian.com/thread/144512?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 09:54:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:22eb6e36-4e87-4f7b-9457-34f76161cc67</guid><dc:creator>Nilanshu Moolwani</dc:creator><description>&lt;p&gt;I didn&amp;#39;t get your point. From what I understood, you had a JSON input and you wanted to extract a value from it. Then why would you use a!toJson() ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Square brackets [] from a string</title><link>https://community.appian.com/thread/144511?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 09:22:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6d8ffd26-8cc9-4418-9a70-c0fe1fb13604</guid><dc:creator>vemasani vishnu vardhan</dc:creator><description>&lt;p&gt;i need it inside the a!tojson function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Square brackets [] from a string</title><link>https://community.appian.com/thread/144508?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 07:54:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ad362e56-0f1a-409a-8668-75d85cc93a9a</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;You could also use the extract() function.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;extract(&amp;quot;[&amp;quot;&amp;quot;12hg&amp;quot;&amp;quot;]&amp;quot;, &amp;quot;[&amp;quot;&amp;quot;&amp;quot;, &amp;quot;&amp;quot;&amp;quot;]&amp;quot;)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Square brackets [] from a string</title><link>https://community.appian.com/thread/144503?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 07:21:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:30102db1-0a2e-46bd-bfd2-8290a083b1a3</guid><dc:creator>Nilanshu Moolwani</dc:creator><description>&lt;p&gt;To extract this value from JSON, first you need to parse the JSON using &lt;code&gt;a!fromJson()&lt;/code&gt; to convert it into a dictionary. After that you can access the specific key to retrieve the value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>