<?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>The json Text parameter was not valid JSON</title><link>https://community.appian.com/discussions/f/integrations/34082/the-json-text-parameter-was-not-valid-json</link><description>I am using a!fromJson to convert a JSON string into an Appian value. However, I encounter an error when handling document types. 
 This is the current format I am using: 
 in ER: &amp;quot;&amp;quot;&amp;quot;&amp;quot; &amp;amp; fv!item &amp;amp; &amp;quot;&amp;quot;&amp;quot;:[&amp;quot; &amp;amp; substitute(if(rule!GLB_isBlank(local!data[fv!item</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: The json Text parameter was not valid JSON</title><link>https://community.appian.com/thread/129720?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2024 11:12:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3c8db7dd-f5a1-40b0-ba61-b3b926b4dba8</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Sure. Create a map and apply toJson().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The json Text parameter was not valid JSON</title><link>https://community.appian.com/thread/129718?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2024 10:43:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6c2f5674-a085-4abb-93f6-fe82fcd2da37</guid><dc:creator>MohammedIdrisKhan</dc:creator><description>&lt;p&gt;setting up a parameter in webAPI&lt;br /&gt;&lt;br /&gt;Any alternative that you&amp;#39;d want to suggest instead of&amp;nbsp;&lt;span&gt;Hand-crafting JSON?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The json Text parameter was not valid JSON</title><link>https://community.appian.com/thread/129716?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2024 10:39:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bfb12d9c-7306-426f-9af0-609d1e30757a</guid><dc:creator>MohammedIdrisKhan</dc:creator><description>&lt;p&gt;like any data in db, I&amp;#39;m only concerned regarding the document type, that&amp;#39;s where I&amp;#39;m getting the error, below is the value of field&lt;br /&gt;[Document:115497]; [Document:115501]&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The json Text parameter was not valid JSON</title><link>https://community.appian.com/thread/129714?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2024 10:34:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d006ad7-8f1d-4244-a3e5-07e3886bed9a</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;&lt;a href="/members/mohammedidrisk0003"&gt;MohammedIdrisKhan&lt;/a&gt;&amp;nbsp;And what is the value of local!data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The json Text parameter was not valid JSON</title><link>https://community.appian.com/thread/129713?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2024 10:32:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4cb00d67-d9c8-4b38-9034-02edf64d2ed2</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;What is the purpose of this code? Hand-crafting JSON is a bad idea in general.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The json Text parameter was not valid JSON</title><link>https://community.appian.com/thread/129711?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2024 10:30:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6fc46147-f4f7-4fe5-9a44-ac4bf4eaa914</guid><dc:creator>MohammedIdrisKhan</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data: rule!xxxxxx(
    Id: 8
  ).data[1],
  local!keys: dictutil_getkeys(
    local!data
  ),
  local!listOfDifferences: a!forEach(
    items: local!keys,
    expression: if(fv!item = &amp;quot;yyyyy&amp;quot;,
    &amp;quot;&amp;quot;&amp;quot;&amp;quot; &amp;amp; fv!item &amp;amp; &amp;quot;&amp;quot;&amp;quot;:[&amp;quot; &amp;amp; substitute(if(rule!GLB_isBlank(local!data[fv!item]), &amp;quot;&amp;quot;, tointeger(local!data[fv!item])),&amp;quot;;&amp;quot;,&amp;quot;,&amp;quot;) &amp;amp; &amp;quot;]&amp;quot;,
    &amp;quot;&amp;quot;&amp;quot;&amp;quot; &amp;amp; fv!item &amp;amp; &amp;quot;&amp;quot;&amp;quot;:&amp;quot;&amp;quot;&amp;quot; &amp;amp; local!data[fv!item] &amp;amp; &amp;quot;&amp;quot;&amp;quot;&amp;quot;
    )
  ),
  a!fromJson(
    &amp;quot;{&amp;quot; &amp;amp; joinarray(
      local!listOfDifferences,
      &amp;quot;,&amp;quot;
    ) &amp;amp; &amp;quot;}&amp;quot;
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The json Text parameter was not valid JSON</title><link>https://community.appian.com/thread/129708?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2024 10:20:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:45dc12d3-6d95-42d4-b040-a4cfa4879032</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;That doesn&amp;#39;t make sense. CDT doesn&amp;#39;t have any data. It is the database that has it. And if you are getting data from DB, why do you need to involve JSON?&amp;nbsp;&lt;br /&gt;Can you add the entire code snippet here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The json Text parameter was not valid JSON</title><link>https://community.appian.com/thread/129707?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2024 10:19:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fe698957-c2f1-4f25-931f-21911872fb3b</guid><dc:creator>MohammedIdrisKhan</dc:creator><description>&lt;p&gt;I&amp;#39;m getting data from a CDT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The json Text parameter was not valid JSON</title><link>https://community.appian.com/thread/129706?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2024 10:18:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:de3bf065-edc0-40c8-9bff-b7fa44777ba3</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Just a quick question. How are you getting this JSON? It looks like you are creating one by yourself. So why not directly use a!toJson on a map or dictionary?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The json Text parameter was not valid JSON</title><link>https://community.appian.com/thread/129704?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2024 10:16:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:525879a5-88b3-4e60-a4ab-8d6e03b1eb67</guid><dc:creator>MohammedIdrisKhan</dc:creator><description>&lt;p&gt;getting this output &amp;nbsp;&amp;quot;fieldName&amp;quot; :[&amp;infin;]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The json Text parameter was not valid JSON</title><link>https://community.appian.com/thread/129703?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2024 09:54:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:efe94876-a123-42af-a1f8-2f28ee61a908</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Try to wrap your local!data[item] into integer. This will give you just the numbers and it will become an integer array.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;quot;&amp;quot;&amp;quot;&amp;quot; &amp;amp; fv!item &amp;amp; &amp;quot;&amp;quot;&amp;quot;:[&amp;quot; &amp;amp; substitute(
  if(
    rule!GLB_isBlank(local!data[fv!item]),
    &amp;quot;&amp;quot;,
    tointeger(local!data[fv!item])
  ),
  &amp;quot;;&amp;quot;,
  &amp;quot;,&amp;quot;
) &amp;amp; &amp;quot;]&amp;quot;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>