<?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>Regarding Extract Function</title><link>https://community.appian.com/discussions/f/user-interface/14056/regarding-extract-function</link><description>Hi, 
 I have a local variable that holds data like this. 
 local!data:[id:122,month:12,numberofdays:2]; [id:123,month:1,numberofdays:4]; [id:124,month:12,numberofdays:6]; 
 while extracting the &amp;quot;numberofdays&amp;quot; from the above format by using extract function</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Regarding Extract Function</title><link>https://community.appian.com/thread/63739?ContentTypeID=1</link><pubDate>Tue, 01 Jan 2019 06:29:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f257f2da-6bc4-43e1-b473-9d4ef59db908</guid><dc:creator>Aditya GIll</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!data: tostring(
    {
      {
        id: 122,
        month: 12,
        numberofdays: 2
      },
      {
        id: 123,
        month: 1,
        numberofdays: 4
      },
      {
        id: 124,
        month: 12,
        numberofdays: 6
      }
    }
  ),
  local!january: extract(
    local!data,
    &amp;quot;month:1,numberofdays:&amp;quot;,
    &amp;quot;]&amp;quot;
  ),
  local!january
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Hi Divya,&lt;/p&gt;
&lt;p&gt;In case you are using the extract function, you have to convert the local variable into the string before extracting to get the desired result as mentioned by Carlos. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please find the code for the same. Its working for me as well.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Aditya&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regarding Extract Function</title><link>https://community.appian.com/thread/63738?ContentTypeID=1</link><pubDate>Tue, 01 Jan 2019 05:55:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9aadad3d-5f0a-4b7b-8fe3-46bb44daffba</guid><dc:creator>divya chakka</dc:creator><description>Hi carlos&lt;br /&gt;
I converted to string.But agian got the same error when using the  extract function.Basically we are extract data dynamically thats why we are not using the where contains with index combination and find function.&lt;br /&gt;
&lt;br /&gt;
TIA&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regarding Extract Function</title><link>https://community.appian.com/thread/63701?ContentTypeID=1</link><pubDate>Fri, 28 Dec 2018 13:44:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:47eff683-3b11-44a5-95f8-fc514451c38b</guid><dc:creator>Carlos Santander</dc:creator><description>What type is local!data? Your code works well if it&amp;#39;s a text variable. For instance, this returns 4:&lt;br /&gt;
&lt;br /&gt;
extract(&amp;quot;[id:122,month:12,numberofdays:2]; [id:123,month:1,numberofdays:4]; [id:124,month:12,numberofdays:6];&amp;quot;,&amp;quot;month:1,numberofdays:&amp;quot;,&amp;quot;]&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
My guess is that local!data isn&amp;#39;t a string but an array of either dictionaries or CDTs, in which case you&amp;#39;d be better off using something other than extract. Either a combination of index and wherecontains, or just using find would be better in that case.&lt;br /&gt;
&lt;br /&gt;
If you want to stick to using extract for whatever reason, just convert it to string before passing it to extract.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>