<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem encoding/decoding introducing in a JSON list data in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/problem-encoding-decoding-introducing-in-a-json-list-data/m-p/516935#M1266</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/226640"&gt;@Josep&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need more information on this is issue. Maybe share the code you're running.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Oct 2022 23:59:25 GMT</pubDate>
    <dc:creator>jfernandes1</dc:creator>
    <dc:date>2022-10-05T23:59:25Z</dc:date>
    <item>
      <title>Problem encoding/decoding introducing in a JSON list data</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/problem-encoding-decoding-introducing-in-a-json-list-data/m-p/516871#M1262</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I've some urls to introduce in a JSON list the command used are this one to encode:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#encode to ASCII&lt;/P&gt;
&lt;P&gt;url.encode(encoding='ascii',errors="ignore").decode()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the context the variable is perfect, however inside the JSON list it's not. Even if I call variables from inside the JSON list to outside is perfect too.&lt;/P&gt;
&lt;P&gt;It's only inside the JSON list where differents characters appear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 08:55:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/problem-encoding-decoding-introducing-in-a-json-list-data/m-p/516871#M1262</guid>
      <dc:creator>Josep</dc:creator>
      <dc:date>2022-10-05T08:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem encoding/decoding introducing in a JSON list data</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/problem-encoding-decoding-introducing-in-a-json-list-data/m-p/516935#M1266</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/226640"&gt;@Josep&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need more information on this is issue. Maybe share the code you're running.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 23:59:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/problem-encoding-decoding-introducing-in-a-json-list-data/m-p/516935#M1266</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2022-10-05T23:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem encoding/decoding introducing in a JSON list data</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/problem-encoding-decoding-introducing-in-a-json-list-data/m-p/516952#M1269</link>
      <description>&lt;P&gt;Sorry for not giving more information, I have to be carefull with it. Here it's a smaller part of the program, where a JSON list is loaded, and parameters are changed, then JSON List is updated. The question is about why is not encoded in ASCII even if I force to do it inside the JSON List.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;def main(domain, url):
    domain			=	domain.encode(encoding='ascii',errors="ignore").decode()
    url				=	url.encode(encoding='ascii',errors="ignore").decode()
    allJSON     	=   demisto.executeCommand("getList", {"listName":"JSONList"})
    data        	=   json.loads(allJSON[0]['Contents'])
	newdata  		=   {domain:{"domain": domain,"url":url}}

	if type(data) is list:
		data.append(newdata)
	else:
		data.update(newdata)
	
    demisto.executeCommand("setList",{"listName":"JSONList","listData":data})&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 06:49:06 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/problem-encoding-decoding-introducing-in-a-json-list-data/m-p/516952#M1269</guid>
      <dc:creator>Josep</dc:creator>
      <dc:date>2022-10-06T06:49:06Z</dc:date>
    </item>
  </channel>
</rss>

