<?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 fetch the constant Values using the constant Name?</title><link>https://community.appian.com/discussions/f/rules/11047/how-to-fetch-the-constant-values-using-the-constant-name</link><description>I have the constant name in DB and on the UI, I want to display the constant values for it. How can we retrieve the values for a constant by passing its name?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to fetch the constant Values using the constant Name?</title><link>https://community.appian.com/thread/48399?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 23:16:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5f147c4e-a939-4fed-9b05-ce1397f850d9</guid><dc:creator>Eliot Gerson</dc:creator><description>What is the constant being used for normally? It would be helpful to have a bit more information about your use case.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch the constant Values using the constant Name?</title><link>https://community.appian.com/thread/48379?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 17:49:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cf0d37cf-a826-415f-b096-e2d27eb75ae5</guid><dc:creator>Mike Schmitt</dc:creator><description>I assume the plug-in mentioned in the first reply in this thread is the preferred method.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch the constant Values using the constant Name?</title><link>https://community.appian.com/thread/48378?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 17:47:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:56ff0bf5-976d-4010-b268-5e42512b47da</guid><dc:creator>Durgesh</dc:creator><description>What is the alternate standard function/routine to use instead eval() function?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch the constant Values using the constant Name?</title><link>https://community.appian.com/thread/48376?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 17:11:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c9ef115c-b83c-42cb-b1a2-e0c6d51d6099</guid><dc:creator>harrisont606</dc:creator><description>If the field is user facing they also risk SAIL injection. Somebody could enter some crazy looping function that crashes the system.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch the constant Values using the constant Name?</title><link>https://community.appian.com/thread/48373?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 16:25:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:84d7c29b-6c3e-487e-ad03-0c10300cc638</guid><dc:creator>Mike Cichy</dc:creator><description>DO NOT USE eval() UNDER ANY CIRCUMSTANCES!&lt;br /&gt;
&lt;br /&gt;
It is a hidden function and its use is NOT SUPPORTED. It may change without notice and you will hose your application.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch the constant Values using the constant Name?</title><link>https://community.appian.com/thread/48367?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 15:30:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1c2b4db4-fbd3-4005-9133-6e89c57051c1</guid><dc:creator>Durgesh</dc:creator><description>eval(&amp;quot;cons!&amp;quot; &amp;amp; &amp;quot;&amp;lt;YOUR_CONSTANT_NAME&amp;gt;&amp;quot;) should precisely look for constant only.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch the constant Values using the constant Name?</title><link>https://community.appian.com/thread/48353?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 07:32:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:54762000-f8a7-4397-ac2d-81faab75f506</guid><dc:creator>Rama Thummala</dc:creator><description> , Please use below snippet.It would help you.&lt;br /&gt;
&lt;br /&gt;
eval(&amp;quot;&amp;lt;YOUR_CONSTANT_NAME&amp;gt;&amp;quot;) - &amp;gt;returns constant value.&lt;br /&gt;
Please make sure the Constant is available, else will get error at run time.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch the constant Values using the constant Name?</title><link>https://community.appian.com/thread/48352?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 07:10:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:96c39094-4a51-4589-bd11-9404ffb8f23d</guid><dc:creator>ashokv</dc:creator><description>u can try using the code something similar below:&lt;br /&gt;
&lt;br /&gt;
merge(&lt;br /&gt;
      enumerate(&lt;br /&gt;
        length(&lt;br /&gt;
          constant name&lt;br /&gt;
        )&lt;br /&gt;
      ) + 1,&lt;br /&gt;
      constant name&lt;br /&gt;
    )&lt;br /&gt;
generate a dummy cdt with the above rule and use it wherever you req.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch the constant Values using the constant Name?</title><link>https://community.appian.com/thread/48337?ContentTypeID=1</link><pubDate>Fri, 08 Sep 2017 14:58:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a0917089-5298-4dcb-940a-c16c70a2a932</guid><dc:creator>Mike Schmitt</dc:creator><description>you could possibly use the eval() function for this too, though as &lt;a href="/members/sureshg57"&gt;sureshg57&lt;/a&gt; already pointed out, either method presented here will present you maintenance challenges and risk of breaking (for instance, you will have no way of checking whether one of the constant names in the DB doesn&amp;#39;t match a real constant, and risk throwing an error).&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch the constant Values using the constant Name?</title><link>https://community.appian.com/thread/48335?ContentTypeID=1</link><pubDate>Fri, 08 Sep 2017 14:18:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:986a9376-40eb-461e-96fa-2c00f390ccdb</guid><dc:creator>sureshg57</dc:creator><description>This is one plugin you can use. &lt;a href="https://forum.appian.com/suite/tempo/records/item/lMBCLGOdlMUpdGVqW3dQaIKmclBmvvNEj8vu_cjb7T-5YiPr4Fu8ly5Yj1s09uenE4RYzA8zKyx7eiUhuOmLnMUIbEY3UiZIpFgSRrb8sITUpWUJg/view/summary"&gt;forum.appian.com/.../summary&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But I do highly recommend not to use a solution like this if you have any other way of handling you requirement as this can become hard to maintain&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>