<?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>Need to get the document name from a ruleinput</title><link>https://community.appian.com/discussions/f/user-interface/19547/need-to-get-the-document-name-from-a-ruleinput</link><description>Hi, 
 As, I&amp;#39;m trying to fetch the document name using ruleinput(CDT linked). But i&amp;#39;m getting the following error 
 ERROR: 
 The passed parameter(s) are of the wrong type. Received the type List of Variant. 
 I have achieved this by calling the same data</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Need to get the document name from a ruleinput</title><link>https://community.appian.com/thread/76435?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2020 18:42:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7c27e273-f5a6-4557-9a94-8173beb87d91</guid><dc:creator>Harris</dc:creator><description>&lt;p&gt;Thank you Christine&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to get the document name from a ruleinput</title><link>https://community.appian.com/thread/76434?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2020 18:41:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bb4e6250-7962-4f61-918c-5d68c0123182</guid><dc:creator>Harris</dc:creator><description>&lt;p&gt;Perfect!!...Thank you so much Mike...&lt;/p&gt;
&lt;p&gt;&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/263a.svg" title="Relaxed"&gt;&amp;#x263a;&lt;/span&gt;&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f44d.svg" title="Thumbsup"&gt;&amp;#x1f44d;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to get the document name from a ruleinput</title><link>https://community.appian.com/thread/76432?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2020 16:56:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8e40a081-4e2c-466a-90c3-ddd5b4cb1474</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Alternately, if &lt;em&gt;local!getEmpDetails&lt;/em&gt; is supposed to only contain one entry, you would want to take the first index of the query results, such as by adding [1] after &lt;em&gt;.data&lt;/em&gt;, or by calling the &lt;em&gt;index()&lt;/em&gt; function on it.&amp;nbsp; Another way that&amp;#39;d work (and let you skip type casting the document id, to boot) would be to cast the query result to your CDT type, using &lt;em&gt;cast()&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Examples:&lt;br /&gt;&lt;pre class="ui-code" data-mode="java"&gt;/* variant 1 */
a!localVariables(
  /* assumes there will always be (at least) one result; will break if there are 0 results */
  local!getempdetails: rule!HD_getEmpDetailsbyId(
    id: ri!id
  ).data[1],

  a!sectionLayout(
    label: document(tointeger(local!getempdetails.resume), &amp;quot;name&amp;quot;)
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;/* variant 2 */
a!localVariables(
  /* safe against 0 query results. slightly increased code complexity. */
  local!getempdetails: index(
    rule!HD_getEmpDetailsbyId(
      id: ri!id
    ).data,
    1,
    {}
  ),

  a!sectionLayout(
    label: document(tointeger(local!getempdetails.resume), &amp;quot;name&amp;quot;)
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;/* variant 3 */
a!localVariables(
  /* also safe against 0 query results. no need to type cast later. */
  local!getEmpDetails: cast(
    &amp;#39;type!{urn:com:appian:types:EXAMPLE}YourCDTGoesHere&amp;#39;,
    rule!HD_getEmpDetailsbyId(
      id: ri!id
    ).data
  ),

  a!sectionLayout(
    label: document(local!getempdetails.resume, &amp;quot;name&amp;quot;)
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to get the document name from a ruleinput</title><link>https://community.appian.com/thread/76431?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2020 16:48:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:70d98f1a-bd1a-49ca-b76a-4f2ffd753969</guid><dc:creator>ChristineLHutchison</dc:creator><description>&lt;p&gt;If I am reading the error that you posted correctly, it is because the local is an array (even if only one value is in it). You need to look at putting this in a looping function or point to a specific index. Hope that helps&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to get the document name from a ruleinput</title><link>https://community.appian.com/thread/76429?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2020 16:31:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:19bc7d23-f77c-4249-bc6e-dd2b78997094</guid><dc:creator>Harris</dc:creator><description>&lt;p&gt;Hi Chris,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;no luck, Still I&amp;#39;m getting the same error.&lt;/p&gt;
&lt;p&gt;Please find the below snippet.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/13/Screen-Shot-2020_2D00_09_2D00_11-at-10.00.36-PM.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to get the document name from a ruleinput</title><link>https://community.appian.com/thread/76428?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2020 15:41:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6a0c5b84-0dc1-47ed-bab5-493fc215639b</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;First I would try wrapping the values in todocument() to get past the type mismatch, and go from there:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;label: {
/*&amp;quot;&amp;quot; &amp;amp; document(todocument(local!emp.resume),&amp;quot;name&amp;quot;) ,*/
&amp;quot;&amp;quot; &amp;amp; document(todocument(local!getempdetails.resume),&amp;quot;name&amp;quot;)
},&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>