<?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>resource efficient way to use of variables that depend upon each other that refer to long JSON paths</title><link>https://community.appian.com/discussions/f/general/21732/resource-efficient-way-to-use-of-variables-that-depend-upon-each-other-that-refer-to-long-json-paths</link><description>Hi community, 
 I am wondering how the following use case will affect recourses and/or if there is a better way to approach it. I have to fetch several date from a JSON respons where the data I need is stored in multiple and long JSON paths, some 8 levels</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: resource efficient way to use of variables that depend upon each other that refer to long JSON paths</title><link>https://community.appian.com/thread/85003?ContentTypeID=1</link><pubDate>Thu, 26 Aug 2021 12:20:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0ef358c2-b4f0-4e40-b2c0-3bb61e492669</guid><dc:creator>erikb0001</dc:creator><description>&lt;p&gt;Thank you Stefan, I will keep that in mind.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: resource efficient way to use of variables that depend upon each other that refer to long JSON paths</title><link>https://community.appian.com/thread/85002?ContentTypeID=1</link><pubDate>Thu, 26 Aug 2021 12:19:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ae3bd5fb-96c9-463a-8454-a0c88cb6c468</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;index() will help you to catch the case that field does not exist at all. If you know that all the fields are always available, just go with the dot-notation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: resource efficient way to use of variables that depend upon each other that refer to long JSON paths</title><link>https://community.appian.com/thread/85001?ContentTypeID=1</link><pubDate>Thu, 26 Aug 2021 11:23:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ce69411c-74eb-4dc8-8b0c-1de9482c68b4</guid><dc:creator>erikb0001</dc:creator><description>&lt;p&gt;Thanks Stefan,&lt;/p&gt;
&lt;p&gt;Your assumption is right, the values will be used in a CDT.&lt;br /&gt;I started with separate variable&amp;#39;s to individually check the responses fist, also for the majority of fields I also have to &amp;quot;filter&amp;quot; using for each to get the right value(s) out of the array. Now that I am able to correctly fetch the data along with your answer to my question, I will indeed initialize the CDT with the values by dot notation full path for each field in the CDT and then wrap them like this to handle null values.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;companyEmail: index(local!totalRespons.result.body.serverInfo.company.contactInfo.item&amp;quot;email&amp;quot;, null),&lt;/p&gt;
&lt;p&gt;Or is this not a good thing to do?&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: resource efficient way to use of variables that depend upon each other that refer to long JSON paths</title><link>https://community.appian.com/thread/85000?ContentTypeID=1</link><pubDate>Thu, 26 Aug 2021 10:53:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3229f7d8-b22f-4480-8d69-85540fb6e7f5</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I think that multiple lines like&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;local!companyEmail: local!totalRespons.result.body.serverInfo.company.contactInfo.item.email&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;are super readable.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What do you then do with these values? Why create a local for each? I assume you want to transfer them into your own CDT. Then you can do this&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;type!YourCDT(
  companyEmail: local!totalRespons.result.body.serverInfo.company.contactInfo.item.email,
  .
  .
  .
)&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>