<?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>Select an option when a value comes preloaded</title><link>https://community.appian.com/discussions/f/general/14654/select-an-option-when-a-value-comes-preloaded</link><description>I have a form B with three fields that appears when I clicked the &amp;quot;send&amp;quot; button from another form A. a!formLayout( label: &amp;quot;Form&amp;quot;, contents: { a!textField( label: &amp;quot;City&amp;quot;, labelPosition: &amp;quot;ABOVE&amp;quot;, saveInto: {}, refreshAfter: &amp;quot;UNFOCUS&amp;quot;, validations: {} )</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Select an option when a value comes preloaded</title><link>https://community.appian.com/thread/65783?ContentTypeID=1</link><pubDate>Wed, 10 Apr 2019 07:29:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:282e2299-bc02-47e8-9d3c-b61a840fd0d7</guid><dc:creator>Alastr</dc:creator><description>&lt;pre class="tw-data-text tw-ta tw-text-small" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;Thank you so much for help me. He helped me totally for what I wanted to do&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Select an option when a value comes preloaded</title><link>https://community.appian.com/thread/65746?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 11:26:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:21003940-e17b-4906-8137-f2f844ade42f</guid><dc:creator>viveku3486</dc:creator><description>&lt;p&gt;What about this?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;load(&lt;br /&gt; local!random: tointeger(&lt;br /&gt; split(&lt;br /&gt; tostring(&lt;br /&gt; rand()&lt;br /&gt; ),&lt;br /&gt; &amp;quot;.&amp;quot;&lt;br /&gt; )[2]&lt;br /&gt; ),&lt;br /&gt; &lt;br /&gt; /*local!random:null,*/&lt;br /&gt; local!selectedValue:if(&lt;br /&gt; and(&lt;br /&gt; not(isnull(local!random)),&lt;br /&gt; len(local!random)&amp;gt;0&lt;br /&gt; ),&lt;br /&gt; {&amp;quot;urgency&amp;quot;},&lt;br /&gt; null&lt;br /&gt; ),&lt;br /&gt; &lt;br /&gt; {&lt;br /&gt; a!integerField(&lt;br /&gt; label: &amp;quot;PROPOSED&amp;quot;,&lt;br /&gt; labelPosition: &amp;quot;ADJACENT&amp;quot;,&lt;br /&gt; value: local!random,&lt;br /&gt; saveInto: {},&lt;br /&gt; refreshAfter: &amp;quot;UNFOCUS&amp;quot;,&lt;br /&gt; readonly: true,&lt;br /&gt; validations: {}&lt;br /&gt; ),&lt;br /&gt; a!radioButtonField(&lt;br /&gt; label: &amp;quot;Type&amp;quot;,&lt;br /&gt; labelposition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt; choiceLabels: {&amp;quot;car&amp;quot;,&amp;quot;model&amp;quot;,&amp;quot;urgency&amp;quot;},&lt;br /&gt; choiceValues: {&amp;quot;car&amp;quot;,&amp;quot;model&amp;quot;,&amp;quot;urgency&amp;quot;},&lt;br /&gt; value: local!selectedValue,&lt;br /&gt; saveInto: local!selectedValue,&lt;br /&gt; required: true&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Select an option when a value comes preloaded</title><link>https://community.appian.com/thread/65745?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 11:04:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:821398ca-b432-4942-aaf0-bbd037a4a68e</guid><dc:creator>Alastr</dc:creator><description>&lt;pre class="tw-data-text tw-ta tw-text-medium" dir="ltr"&gt;&lt;span lang="en"&gt;entering the code I get the result so&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1554807670597v1.png" alt=" " /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="tw-data-text tw-ta tw-text-medium" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;and what I want is like this&lt;br /&gt;&lt;/span&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1554807835366v3.png" alt=" " /&gt;&lt;/pre&gt;
&lt;div class="oSioSc"&gt;
&lt;div id="tw-target"&gt;
&lt;div class="gsrt tw-ta-container tw-nfl" id="tw-target-text-container"&gt;
&lt;pre class="tw-data-text tw-ta tw-text-small" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;that when loading the form the random number and already selected urgency come...&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre class="tw-data-text tw-ta tw-text-medium" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Select an option when a value comes preloaded</title><link>https://community.appian.com/thread/65744?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 10:51:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0903b9d8-54f5-4f98-91ae-fad978da2f3e</guid><dc:creator>viveku3486</dc:creator><description>&lt;p&gt;I modified your code to fulfill your requirement. Kindly check once&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;load(&lt;br /&gt; local!random: tointeger(&lt;br /&gt; split(&lt;br /&gt; tostring(&lt;br /&gt; rand()&lt;br /&gt; ),&lt;br /&gt; &amp;quot;.&amp;quot;&lt;br /&gt; )[2]&lt;br /&gt; ),&lt;br /&gt; local!new,&lt;br /&gt; local!choiceOption:if(&lt;br /&gt; and(&lt;br /&gt; not(isnull(local!random)),&lt;br /&gt; len(local!random)&amp;gt;0&lt;br /&gt; ),&lt;br /&gt; {&amp;quot;urgency&amp;quot;},&lt;br /&gt; {&amp;quot;car&amp;quot;,&amp;quot;model&amp;quot;,&amp;quot;urgency&amp;quot;}&lt;br /&gt; ),&lt;br /&gt; &lt;br /&gt; {&lt;br /&gt; a!integerField(&lt;br /&gt; label: &amp;quot;PROPOSED&amp;quot;,&lt;br /&gt; labelPosition: &amp;quot;ADJACENT&amp;quot;,&lt;br /&gt; value: local!random,&lt;br /&gt; saveInto: {},&lt;br /&gt; refreshAfter: &amp;quot;UNFOCUS&amp;quot;,&lt;br /&gt; readonly: true,&lt;br /&gt; validations: {}&lt;br /&gt; ),&lt;br /&gt; a!radioButtonField(&lt;br /&gt; label: &amp;quot;Type&amp;quot;,&lt;br /&gt; labelposition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt; choiceLabels: local!choiceOption,&lt;br /&gt; choiceValues: local!choiceOption,&lt;br /&gt; value: local!new,&lt;br /&gt; saveInto: local!new,&lt;br /&gt; required: true&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Select an option when a value comes preloaded</title><link>https://community.appian.com/thread/65743?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 10:41:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:00c98c41-284a-4a4f-8887-83621cd7f1aa</guid><dc:creator>Alastr</dc:creator><description>&lt;div class="tw-swapa"&gt;
&lt;div class="DHcWmd"&gt;
&lt;div class="oSioSc"&gt;
&lt;div id="tw-target"&gt;
&lt;div class="gsrt tw-ta-container tw-nfl" id="tw-target-text-container"&gt;
&lt;pre class="tw-data-text tw-ta tw-text-small" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;thanks for answering but now I have another question&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="oSioSc"&gt;
&lt;div id="tw-target"&gt;
&lt;div class="gsrt tw-ta-container tw-nfl" id="tw-target-text-container"&gt;
&lt;pre class="tw-data-text tw-ta tw-text-small" style="padding-left:30px;" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;I have a &amp;quot;new&amp;quot; form with two fields.
The first &amp;quot;proposed&amp;quot; field is an entire field.
The second &amp;quot;type&amp;quot; field is radiobutton with three options: &amp;quot;car&amp;quot;, &amp;quot;model&amp;quot; and &amp;quot;urgent&amp;quot;.
When I enter the form the first field is loaded with a random number and I can choose an option of the second field.&lt;br /&gt;
&lt;span style="color:#ff0000;"&gt;But now I want that when you enter the form and the random number is loaded, you select only the &amp;quot;urgent&amp;quot; option&lt;br /&gt;&lt;br /&gt;&lt;em&gt;load(&lt;/em&gt;&lt;br /&gt;&lt;em&gt; local!random: tointeger(split(tostring(rand()), &amp;quot;.&amp;quot;)[2]),&lt;/em&gt;&lt;br /&gt;&lt;em&gt; {&lt;/em&gt;&lt;br /&gt;&lt;em&gt;a!integerField(&lt;/em&gt;&lt;br /&gt;&lt;em&gt; label: &amp;quot;PROPOSED&amp;quot;,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; labelPosition: &amp;quot;ADJACENT&amp;quot;,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; value: local!random,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; saveInto: {},&lt;/em&gt;&lt;br /&gt;&lt;em&gt; refreshAfter: &amp;quot;UNFOCUS&amp;quot;,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; readonly: true,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; validations: {}&lt;/em&gt;&lt;br /&gt;&lt;em&gt; ),&lt;/em&gt;&lt;br /&gt;&lt;em&gt;a!radioButtonField(&lt;/em&gt;&lt;br /&gt;&lt;em&gt; label: &amp;quot;Type&amp;quot;,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; labelposition: &amp;quot;ABOVE&amp;quot;,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; choiceLabels: {&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;quot;car&amp;quot;,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;quot;model&amp;quot;,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;quot;urgency&amp;quot;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; },&lt;/em&gt;&lt;br /&gt;&lt;em&gt; choiceValues: {&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;quot;car&amp;quot;,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;quot;model&amp;quot;,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;quot;urgency&amp;quot;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; },&lt;/em&gt;&lt;br /&gt;&lt;em&gt; value: ri!new.typeS,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; saveInto: ri!new.typeS,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; required: true&lt;/em&gt;&lt;br /&gt;&lt;em&gt; )&lt;/em&gt;&lt;br /&gt; &lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;br /&gt;&lt;em&gt;)&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Select an option when a value comes preloaded</title><link>https://community.appian.com/thread/65742?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 09:54:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:29f8a273-00b7-4204-81aa-685d7a5f6d57</guid><dc:creator>viveku3486</dc:creator><description>&lt;p&gt;Hello Alastr,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;On form A, You can create one local variable say &amp;quot;radioChoice&amp;quot;. Now suppose if user enters something inside &amp;quot;office&amp;quot; field during that time you can populate the value for local!radioChoice to &amp;quot;Urgency&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now pass the value to form B and use this variable inside value and saveinto parameter of radio control.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sample code is as below&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Form A&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;load(&lt;/p&gt;
&lt;p&gt;local!radioChoice,&lt;/p&gt;
&lt;p&gt;local!office,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;a!textfield(&lt;/p&gt;
&lt;p&gt;label:&amp;quot;Office&amp;quot;,&lt;/p&gt;
&lt;p&gt;value:local!office,&lt;/p&gt;
&lt;p&gt;saveinto:{&lt;/p&gt;
&lt;p&gt;local!office,&lt;/p&gt;
&lt;p&gt;a!save(&lt;/p&gt;
&lt;p&gt;local!radioChoice,&lt;/p&gt;
&lt;p&gt;if(&lt;/p&gt;
&lt;p&gt;and(&lt;/p&gt;
&lt;p&gt;not(isnull(save!value)),&lt;/p&gt;
&lt;p&gt;len(save!vaue)&amp;gt;0&lt;/p&gt;
&lt;p&gt;),&lt;/p&gt;
&lt;p&gt;&amp;quot;Urgency&amp;quot;,&lt;/p&gt;
&lt;p&gt;null&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Pass this local!radioButton Parameter to form B and the code on form B be something like&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Form B&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;a!radiobutton(&lt;/p&gt;
&lt;p&gt;label:&amp;quot;Type&amp;quot;,&lt;/p&gt;
&lt;pre class="tw-data-text tw-ta tw-text-small" dir="ltr"&gt;&lt;span lang="en"&gt;choiceLabels: {&lt;br /&gt; &amp;quot;car&amp;quot;,&lt;br /&gt; &amp;quot;red&amp;quot;,&lt;br /&gt; &amp;quot;urgency&amp;quot;&lt;br /&gt; },&lt;br /&gt; choiceValues: {&lt;br /&gt; &amp;quot;car&amp;quot;,&lt;br /&gt; &amp;quot;red&amp;quot;,&lt;br /&gt; &amp;quot;urgency&amp;quot;&lt;br /&gt; },&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;value:ri!radioChoice,          //Parameter that was passed from form A&lt;br /&gt;saveinto: ri!radioChoice&lt;/pre&gt;
&lt;p&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>