<?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>Find and update data from multidimensional array of objects</title><link>https://community.appian.com/discussions/f/general/19884/find-and-update-data-from-multidimensional-array-of-objects</link><description>I have an array which contains multiple objects, for example local!cartItems: [ {id:22,name:abx,cost:10,qty:1}, {id:23,name:xyz,cost:15,qty:1}, {id:24,name:jkl,cost:18,qty:1}, {id:25,name:test ,cost:50,qty:1} ] 
 now I want to get the object whose id</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Find and update data from multidimensional array of objects</title><link>https://community.appian.com/thread/77695?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 09:25:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:99cbe73b-06e5-4b3a-852a-725d46cd6556</guid><dc:creator>ranjank0001</dc:creator><description>&lt;p&gt;Thanks Stefan!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Find and update data from multidimensional array of objects</title><link>https://community.appian.com/thread/77694?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 09:16:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1f9c0f0a-481c-4803-b060-74839f3379da</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Try lookup(local!cartItems.id, 24)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Find and update data from multidimensional array of objects</title><link>https://community.appian.com/thread/77692?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 09:10:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ba58c81a-e0ad-472b-b197-ae876dcbc061</guid><dc:creator>ranjank0001</dc:creator><description>&lt;p&gt;Thanks for your response!&lt;/p&gt;
&lt;p&gt;But how to find any item by key-value like how can I get item or index of the item whose id is 24. lookup() and wherecontains() are for indexed arrays but I don&amp;#39;t understand how to match the key-value and get the index of the item.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Find and update data from multidimensional array of objects</title><link>https://community.appian.com/thread/77688?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2020 08:18:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0a40a698-9417-4324-a0ff-e14bedfc3f5a</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;In Appian, local variables are immutable. Taking aside that in interfaces you can modify variable in a saveInto. But in general, you can use lookup() or wherecontains() to find items in a list, index() or &amp;quot;[]&amp;quot; to fetch that item and updatearray() to create a new array with modified data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>