<?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>Hi, I am trying to use the web service function in a rule to deliver several ele</title><link>https://community.appian.com/discussions/f/rules/6311/hi-i-am-trying-to-use-the-web-service-function-in-a-rule-to-deliver-several-ele</link><description>Hi, I am trying to use the web service function in a rule to deliver several elements of data. The function itself is working just fine but I can&amp;#39;t seem to find a way to output just two elements from the result. I can isolate a single variable or the</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Hi, I am trying to use the web service function in a rule to deliver several ele</title><link>https://community.appian.com/thread/24704?ContentTypeID=1</link><pubDate>Mon, 16 Nov 2015 13:59:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:23b4c870-ae96-4d9f-9edb-3edfdc13414a</guid><dc:creator>PhilB</dc:creator><description>You might be interested to know that, given a structure local!data: {key: 1, value: &amp;quot;one&amp;quot;}, you can get the data using dot notation - local!data.key - or use the index function - index(local!data, &amp;quot;key&amp;quot;, null) - rather than using the json function.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi, I am trying to use the web service function in a rule to deliver several ele</title><link>https://community.appian.com/thread/24618?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 16:01:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6941820f-2340-43c8-8db0-1ddd5700bd7d</guid><dc:creator>james.franklin</dc:creator><description>Thanks Tim and Stefan. Both of your answers influenced the current end result which is this:&lt;br /&gt;&lt;br /&gt;with(&lt;br /&gt;  local!wsdlUrl: rule!dynamicOBAWSurl(cons!THIS_ENVIRONMENT),&lt;br /&gt;  local!wsResult: webservicequery(&lt;br /&gt;  wsConfig:&lt;br /&gt;    a!wsConfig(&lt;br /&gt;      wsdlUrl: local!wsdlUrl,&lt;br /&gt;      service: &amp;quot;{&lt;a&gt;appian.ZZZZ.org/}Appian&amp;quot;,&lt;/a&gt;&lt;br /&gt;      port: &amp;quot;AppianSoap12&amp;quot;,&lt;br /&gt;      operation: &amp;quot;{&lt;a&gt;appian.ZZZZ.org/}GetCost&amp;quot;&lt;/a&gt;&lt;br /&gt;    ),&lt;br /&gt;   inputVar: {&lt;br /&gt;     GetCostSoapIn: {&lt;br /&gt;      orderUrn: ri!URN,&lt;br /&gt;      orderVersion: ri!Version,&lt;br /&gt;      ObaInstance: ri!OBA,&lt;br /&gt;      MonthsSpend: 0&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;),&lt;br /&gt;&amp;quot;{grossPrice: &amp;quot;&amp;amp;local!wsResult.returnValue.GetCostSoapOut.GetCostResult.Total_Gross_Price&amp;amp;&amp;quot;; monthSpend: &amp;quot;&amp;amp;local!wsResult.returnValue.GetCostSoapOut.GetCostResult.Last_6_Months_Net_Spend&amp;amp;&amp;quot;}&amp;quot;&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;The final output of the rule is extracted to pv! in a script task from the ac! using: &lt;br /&gt;&lt;br /&gt;readjson(ac!Param1,&amp;quot;grossPrice&amp;quot;)&lt;br /&gt;&lt;br /&gt;For my use case this has delivered what I needed. Which was to display data on a task form in the apps environment. Ideally this will be pulled on demand from within the form as a default value but this might prove to be prohibitive due to load times within the form. If this is the case then pre-processing of the data will be required and a switch of storage to CDT a more suitable method.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi, I am trying to use the web service function in a rule to deliver several ele</title><link>https://community.appian.com/thread/24614?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 10:30:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5f4a420d-181d-4704-8097-670ab75ee74a</guid><dc:creator>Stefan Helzle</dc:creator><description>You can do this without creating a CDT for it. Just use the default way of how Appian defines a data structure. This is: {key1: value1, key2: value2, ...}&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi, I am trying to use the web service function in a rule to deliver several ele</title><link>https://community.appian.com/thread/24611?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 03:09:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:92fc7a47-7376-45b5-89b2-f10d26bcb795</guid><dc:creator>james.franklin</dc:creator><description>Thanks Tim, that makes sense. I thought that if I drop the output to a text variable I could reference the content as if it was a dictionary but this isn&amp;#39;t the case either as it appears to flatten the complex type returned from the web service into a string.&lt;br /&gt;I will do as you suggest and write to a cat instead using the type! constructor.&lt;br /&gt;Cheers, James&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi, I am trying to use the web service function in a rule to deliver several ele</title><link>https://community.appian.com/thread/24589?ContentTypeID=1</link><pubDate>Wed, 11 Nov 2015 18:51:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:56eb227c-0fd4-4d9b-9969-1923cb924582</guid><dc:creator>Tim</dc:creator><description>Ideally you should look to populate the response into a CDT so that it can easily be used in Appian. So the last line in your expression could be a type constructor i.e.&lt;br /&gt;type!myAppianCDT(id: &amp;lt;parsedValue&amp;gt;, field1: &amp;lt;parsedValue&amp;gt; .....)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>