<?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>How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/discussions/f/general/13013/how-to-maintain-a-key-value-pair-in-a-constant-and-pick-the-value-by-passing-the-key</link><description>Hi, 
 May I know how to maintain a key value pair values in a constant and refer the constant in an expression rule and pick the respective value by passing the key name. 
 Eg: &amp;quot;72&amp;quot;-&amp;quot;ABC&amp;quot; 
 &amp;quot;75&amp;quot;-&amp;quot;DEF&amp;quot; 
 &amp;quot;80&amp;quot;-&amp;quot;GHI&amp;quot; 
 
 I need to get the value &amp;quot;ABC&amp;quot; by</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58561?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 15:39:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b9c35a28-c4b8-44d6-9c01-56b73b29c20c</guid><dc:creator>Jim Schweitzer</dc:creator><description>You could try keyval() function&lt;br /&gt;
&lt;a href="https://docs.appian.com/suite/help/18.2/fnc_text_keyval.html"&gt;docs.appian.com/.../fnc_text_keyval.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
keyval({&amp;quot;72-ABC&amp;quot;,&amp;quot;75-DEF&amp;quot;,&amp;quot;80-GHI&amp;quot;}, {72}, &amp;quot;-&amp;quot;) = &amp;quot;ABC&amp;quot;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58557?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 14:44:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f12e1612-bf2b-466e-b0ce-e3c06645a015</guid><dc:creator>Wed Prakash Gupta</dc:creator><description>It&amp;#39;s a shared component, go through this link:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://forum.appian.com/suite/tempo/records/item/lMBCLGOdlMUpdGVqW3dQaIKmclBmvvNEj8vu_cjb7T-5YiPr4Fu8ly5Yj1s09uenE4RYzA8zKyx7eiUheOhLnNchExFc_zByR77Pl9QSc9NnBjTFA/view/summary"&gt;forum.appian.com/.../summary&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58545?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 14:13:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:11a4fe79-fe64-4b4f-8ba5-b3554048fe22</guid><dc:creator>yeswanththiyarir</dc:creator><description>You could use Decision or display value. But using a decision would be easier and as it is an object it has more reusability.&lt;br /&gt;
Thanks&lt;br /&gt;
Yeswanth.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58531?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 13:02:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7beed0ad-5d0f-49b0-a487-d75d48bedd14</guid><dc:creator>srinandhavin5120</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;One suggestion where we can use a constant to solve this.&lt;/p&gt;
&lt;p&gt;1. We can create a constant of type Text Array and give the values like [key=value]&lt;/p&gt;
&lt;p&gt;[72=ABC] where 72 is the key, = is the separator and ABC is the value&lt;br /&gt;[75=DEF]&lt;br /&gt;[80=GHI]&lt;/p&gt;
&lt;p&gt;Refer Screenshot below&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/11/pastedimage1533041450569v1.png"&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1533041450569v1.png" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2. To access these values from a rule, we can use the&amp;nbsp;function keyval()&lt;/p&gt;
&lt;p&gt;Refer:&amp;nbsp;&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/18.1/fnc_text_keyval.html"&gt;Link to Documentaion keyval()&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The following code takes key as input and returns the value:&lt;/p&gt;
&lt;p&gt;keyval(&lt;br /&gt;joinarray(&lt;br /&gt;cons!test_keyval,&lt;br /&gt;&amp;quot;&amp;quot;&lt;br /&gt;),&lt;br /&gt;ri!key,&lt;br /&gt;&amp;quot;=&amp;quot;,&lt;br /&gt;&amp;quot;]&amp;quot;&lt;br /&gt;)&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/11/pastedimage1533042067485v2.png"&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1533042067485v2.png" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58519?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 11:54:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4bb94042-6564-4fb0-ba26-f360eea8c0c4</guid><dc:creator>rp_balaji</dc:creator><description>Hi Prakash,&lt;br /&gt;
&lt;br /&gt;
Am using 18.2 version and I couldn&amp;#39;t find the function loadBundle(), may I know if it is deprecated in the latest versions.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Balaji.R&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58515?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 11:30:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e4856a5e-fb9d-40fd-9e8a-e9856399d55d</guid><dc:creator>santhosh Kumar</dc:creator><description>Hi Balaji&lt;br /&gt;
&lt;br /&gt;
The function displayvalue() could be one of the solutions for your requirement. &lt;br /&gt;
&lt;br /&gt;
load(&lt;br /&gt;
  local!a: {&lt;br /&gt;
    &amp;quot;72&amp;quot;,&lt;br /&gt;
    &amp;quot;75&amp;quot;,&lt;br /&gt;
    &amp;quot;80&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  local!b: {&lt;br /&gt;
    &amp;quot;ABC&amp;quot;,&lt;br /&gt;
    &amp;quot;DEF&amp;quot;,&lt;br /&gt;
    &amp;quot;GHI&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  displayvalue(&lt;br /&gt;
    ri!input,&lt;br /&gt;
    local!a,&lt;br /&gt;
    local!b,&lt;br /&gt;
    null()&lt;br /&gt;
  )&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
Santhosh&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58514?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 11:28:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:52b53c3b-fd38-414f-9e14-5e7c4e631d10</guid><dc:creator>Wed Prakash Gupta</dc:creator><description>Hi rpbalaji2006,&lt;br /&gt;
&lt;br /&gt;
You can also use loadBundle() function which takes a constant of text document. The document contains pair of key and its value. You need to take output of function in a local variable, later on you can use this local variable as local!variable[key] to get the value.&lt;br /&gt;
&lt;br /&gt;
Thanks &amp;amp; Regards,&lt;br /&gt;
Wed Prakash Gupta&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58511?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 10:37:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:63fe97e7-5329-4080-a86b-b821076b537e</guid><dc:creator>rp_balaji</dc:creator><description>Hi Chandu,&lt;br /&gt;
&lt;br /&gt;
Thanks for the suggestion it helped me and the response is quite fast as well.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Balaji.R&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58507?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 09:30:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cbd8d055-db90-4c5c-8255-ecf34408ddc2</guid><dc:creator>chandu</dc:creator><description>Hi Balaji, Why don&amp;#39;t you go with Displayvalue function ? did you ever tried that?&lt;br /&gt;
Please go through the documentation here. &lt;br /&gt;
&lt;a href="https://docs.appian.com/suite/help/18.2/fnc_conversion_displayvalue.html"&gt;docs.appian.com/.../fnc_conversion_displayvalue.html&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58506?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 09:03:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3e2dd22d-a82e-4565-92ad-1ad312c20255</guid><dc:creator>rp_balaji</dc:creator><description>Thanks ekanshj for your suggestion.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58505?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 09:03:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dbc4ba9f-b91b-4d76-9e41-8b83534f6bf7</guid><dc:creator>rp_balaji</dc:creator><description>Thanks Sandeep.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58504?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 08:42:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:af82a7c3-b7bb-4a54-a4ff-fc67c144cf83</guid><dc:creator>Sandeep Deshmukh</dc:creator><description>Balaji,&lt;br /&gt;
Decision is an alternative here. except DB table (rather than constant) or custom expression rule,I do not think we have any other option to maintain key-value.&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Sandeep&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58497?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 07:08:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e9351cf2-7281-47d2-b2f6-6c20b27db8b2</guid><dc:creator>rp_balaji</dc:creator><description>Hi Sandeep,&lt;br /&gt;
&lt;br /&gt;
Thanks for your suggestion and 1 question I have here is if I use decision object it could perform a nested IF and check for the conditions till the value matches and Key-Value pair I was interested is because in a key-value pair the search might not be a nested IF but if we don&amp;#39;t have option of maintaining key-value pair in Appian then decision is the best way of handling it. Please correct me if my understanding is wrong.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Balaji.R&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58493?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 06:41:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:30dd4661-becc-4eb4-a3be-aa1b4fac5242</guid><dc:creator>Sandeep Deshmukh</dc:creator><description>Hi &lt;a href="/members/balajir0001"&gt;rp_balaji&lt;/a&gt; ,&lt;br /&gt;
&lt;br /&gt;
If you are using latest version of Appian please explore decision object. There are multiple ways of using Key values but I can suggest decision Object. You need to define your Key as input parameter and  value as output.&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Sandeep&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to maintain a key value pair in a constant and pick the value by passing the key?</title><link>https://community.appian.com/thread/58492?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 06:39:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e011ebea-222c-4c2a-bc03-d0b43df8ae17</guid><dc:creator>ekanshj</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt; You cannot use constant for this but instead create a Decision for this scenario.&lt;br /&gt;Refer to the screenshot to know how it works.&lt;br /&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/11/pastedimage1533019393320v1.png"&gt;&lt;img src="/resized-image/__size/476x110/__key/communityserver-discussions-components-files/11/pastedimage1533019393320v1.png" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>