<?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>Turning query results into array</title><link>https://community.appian.com/discussions/f/data/20206/turning-query-results-into-array</link><description>Dear all, 
 I need to turn the results of the below query into an array including all &amp;quot;submissionunit&amp;quot;s to further use the wherecontains() formula on that. 
 Could anybody tell me which function to use to create an array in that case? 
 
 
 
 Thank you</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Turning query results into array</title><link>https://community.appian.com/thread/95557?ContentTypeID=1</link><pubDate>Thu, 26 May 2022 11:57:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bebeaf4a-9057-474e-849d-49438772d329</guid><dc:creator>Anthony Shepherd</dc:creator><description>&lt;p&gt;Not really sure what you hoping your output will look like but this will convert your record into a map.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;a!localVariables(&lt;br /&gt; local!data: a!queryRecordType(&lt;br /&gt; recordType: /*Record Type*/ ,&lt;br /&gt; filters: {}&lt;br /&gt; pagingInfo: a!pagingInfo(&lt;br /&gt; startIndex: 1, &lt;br /&gt; batchSize: 10&lt;br /&gt; )&lt;br /&gt; ).data,&lt;br /&gt; &lt;br /&gt; a!forEach(&lt;br /&gt; items: local!data,&lt;br /&gt; expression: &lt;br /&gt; a!map(&lt;br /&gt; value: /* fv!item[recordType.field] */&lt;br /&gt; )&lt;br /&gt; &lt;br /&gt; )&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turning query results into array</title><link>https://community.appian.com/thread/95519?ContentTypeID=1</link><pubDate>Thu, 26 May 2022 07:15:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7cfe0b8a-327b-4281-bd97-9435e1820847</guid><dc:creator>Manish_Kumar</dc:creator><description>&lt;p&gt;As Denny said get your data in to dictinonary and then cast it to map&amp;nbsp; more details at-&amp;nbsp; &lt;a href="https://docs.appian.com/suite/help/22.1/fnc_system_map.html"&gt;docs.appian.com/.../fnc_system_map.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turning query results into array</title><link>https://community.appian.com/thread/95518?ContentTypeID=1</link><pubDate>Thu, 26 May 2022 06:40:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a74c8c86-e76a-4be2-a08d-4e0fe2804fb7</guid><dc:creator>tanujd6440</dc:creator><description>&lt;p&gt;Hi ,&lt;br /&gt;&lt;br /&gt;I actually wanted to convert the record query output in map format like (Key,value)&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/pastedimage1653547069685v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I am learning Appian and cannot find any forums that helps.&lt;br /&gt;&lt;br /&gt;Can anybody help in this case?&lt;br /&gt;&lt;br /&gt;Thanks in advance,&lt;br /&gt;Tanuj&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turning query results into array</title><link>https://community.appian.com/thread/78893?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2021 17:57:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:63c24356-021a-416e-85f3-dde6a684600b</guid><dc:creator>Danny Verb</dc:creator><description>&lt;p&gt;a!queryEntity will return a datasubset. You can index into datasubset using the field &amp;#39;data&amp;#39;, for example &amp;#39;local!datasubset2.data&amp;#39; and this will return a list of dictionary. Appian dictionaries can be sliced, this means you can also index into a specific field to get a list of data for that field. For example, &amp;#39;local!datasubset2.data.submissionunit&amp;#39;. However, since indexing with dot notation might break if the field does not exist, I recommend using the index function. &amp;#39;index(local!datasubset2.data, &amp;quot;submissionunit&amp;quot;, {})&amp;#39;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>