<?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>i have an requirement of optimising below query rule used inside grid column ..</title><link>https://community.appian.com/discussions/f/general/26734/i-have-an-requirement-of-optimising-below-query-rule-used-inside-grid-column</link><description>i have an requirement of optimising below grid column , in the value of grid Column i am fetching the required value from query rule.But i have to declare query rule in local variable first and then i have to use 
 
 how shud i fetch the relevant value</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: i have an requirement of optimising below query rule used inside grid column ..</title><link>https://community.appian.com/thread/104955?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2022 06:53:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9def1f4a-668b-4881-973c-09d40e14bb1a</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Based on Harsha&amp;#39;s example, you can also use the displayvalue() function. It looks for a value in the first list, and returns the item from the second list at the same index.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data: {
    a!map(key: &amp;quot;one&amp;quot;, value: &amp;quot;theOne&amp;quot;),
    a!map(key: &amp;quot;two&amp;quot;, value: &amp;quot;theTwo&amp;quot;),
    a!map(key: &amp;quot;three&amp;quot;, value: &amp;quot;theThree&amp;quot;),
  },
  displayvalue(
    &amp;quot;two&amp;quot;,
    local!data.key,
    local!data.value,
    null
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i have an requirement of optimising below query rule used inside grid column ..</title><link>https://community.appian.com/thread/104953?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2022 06:35:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ca2d55f3-6d1b-42ca-a6de-ea798b069d7b</guid><dc:creator>Harsha Sharma</dc:creator><description>&lt;p&gt;You will need to declare a local variable (say local!lookUpRefData) with value&amp;nbsp; rule!&lt;strong&gt;WFM_qeGetLookupRefDataByInput(isactive:true()).&amp;nbsp;&lt;/strong&gt;This rule should work as if when there is no lookupRefId passed, the output returns all the active ref Ids.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then modify your gridColumn&amp;#39;s value to index data from the local variable based on the record Id. E.g.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;index(
index(
local!lookUpRefData,
wherecontains(fv!row[&amp;#39;recordType!FWM_record.id],local!lookUpRefData.recordId),
{}),
&amp;quot;label&amp;quot;,
{}
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Make use of appropriate columns names and you should have the correct data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>