<?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 save value of local variable defined in with() section, into a rule input</title><link>https://community.appian.com/discussions/f/general/12653/how-to-save-value-of-local-variable-defined-in-with-section-into-a-rule-input</link><description>Scenario: 
 
 Trying to save repopulated values into rule input. The prepopulated values are stored in a local variable that is defined in a with() section as in below code. Need to map this value from local variable defined in With() section into rule</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to save value of local variable defined in with() section, into a rule input</title><link>https://community.appian.com/thread/56525?ContentTypeID=1</link><pubDate>Tue, 12 Jun 2018 17:08:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6815d863-0e2c-4317-8058-9e67efc81fce</guid><dc:creator>jeromew</dc:creator><description>Hi anushas0002,&lt;br /&gt;
&lt;br /&gt;
You&amp;#39;re going to have to use a saveInto within a button or editable field to save the value into the rule input.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to save value of local variable defined in with() section, into a rule input</title><link>https://community.appian.com/thread/56524?ContentTypeID=1</link><pubDate>Tue, 12 Jun 2018 17:06:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e97a50e3-4367-4981-af99-fb29c85e9631</guid><dc:creator>namratak356</dc:creator><description>Hi &lt;a href="/members/anushas0002"&gt;anushas0002&lt;/a&gt; , You can do so in saveInto attribute of Update button a!save(ri!Event, local!selectedEvent),&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to save value of local variable defined in with() section, into a rule input</title><link>https://community.appian.com/thread/56523?ContentTypeID=1</link><pubDate>Tue, 12 Jun 2018 17:05:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6ea22d00-b3d2-471c-8b3d-dbc88f58feff</guid><dc:creator>Ankit</dc:creator><description>Hi Anusha,&lt;br /&gt;
&lt;br /&gt;
Why are we defining local variable local!selectedEvent in with as local!selectedEventId is not updating in whole code and if it is is changing basis of any variable than we can define this on that component like &lt;br /&gt;
&lt;br /&gt;
a!save(&lt;br /&gt;
ri!selectedEvent,rule!GetEventByIdExpressionRule(local!selectedEventId)&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
you can refer this code&lt;br /&gt;
&lt;br /&gt;
load(&lt;br /&gt;
/*Replace with your rule to get the employee details */&lt;br /&gt;
local!selectedEvent: rule!GetEventByIdExpressionRule(local!selectedEventId),&lt;br /&gt;
a!sectionLayout(&lt;br /&gt;
label: &amp;quot;Event Details for Event: &amp;quot;,&lt;br /&gt;
contents: {&lt;br /&gt;
a!columnsLayout(&lt;br /&gt;
columns: {&lt;br /&gt;
a!columnLayout(&lt;br /&gt;
contents: {&lt;br /&gt;
a!integerField(&lt;br /&gt;
label: &amp;quot;Id&amp;quot;,&lt;br /&gt;
value: local!selectedEvent.Id,&lt;br /&gt;
saveInto: &lt;br /&gt;
{a!save(ri!Event.Id, save!value),&lt;br /&gt;
a!save(ri!selectedEvent,rule!GetEventByIdExpressionRule(local!selectedEventId))&lt;br /&gt;
},&lt;br /&gt;
readOnly: true&lt;br /&gt;
),&lt;br /&gt;
a!textField(&lt;br /&gt;
label: &amp;quot;Team&amp;quot;,&lt;br /&gt;
value: local!selectedEvent.Team,&lt;br /&gt;
readOnly: true&lt;br /&gt;
)&lt;br /&gt;
}&lt;br /&gt;
),&lt;br /&gt;
a!columnLayout(&lt;br /&gt;
contents: {&lt;br /&gt;
a!textField(&lt;br /&gt;
label: &amp;quot;Requested Date&amp;quot;,&lt;br /&gt;
value: local!selectedEvent.RequestedDate,&lt;br /&gt;
readOnly: true&lt;br /&gt;
),&lt;br /&gt;
a!dropdownField(&lt;br /&gt;
label: &amp;quot;Status&amp;quot;,&lt;br /&gt;
labelPosition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt;
placeholderLabel: &amp;quot;--- Select a Value ---&amp;quot;,&lt;br /&gt;
choiceLabels: local!statusTypes.Status,&lt;br /&gt;
choiceValues: local!statusTypes.Status,&lt;br /&gt;
value: ri!Event.Status,&lt;br /&gt;
saveInto: a!save(ri!Event.Status, save!value)&lt;br /&gt;
)&lt;br /&gt;
}&lt;br /&gt;
),&lt;br /&gt;
a!columnLayout(&lt;br /&gt;
contents: {&lt;br /&gt;
a!textField(&lt;br /&gt;
label: &amp;quot;Sent For Publishing&amp;quot;,&lt;br /&gt;
value: local!selectedEvent.SentForPublishing,&lt;br /&gt;
readOnly: true&lt;br /&gt;
),&lt;br /&gt;
a!textField(&lt;br /&gt;
label: &amp;quot;Published On KLS&amp;quot;,&lt;br /&gt;
value: local!selectedEvent.PublishedOnKls,&lt;br /&gt;
readOnly: true&lt;br /&gt;
)&lt;br /&gt;
}&lt;br /&gt;
)&lt;br /&gt;
}&lt;br /&gt;
),&lt;br /&gt;
a!buttonArrayLayout(&lt;br /&gt;
buttons: {&lt;br /&gt;
a!buttonWidget(&lt;br /&gt;
label: &amp;quot;Cancel&amp;quot;,&lt;br /&gt;
saveInto: {},&lt;br /&gt;
style: &amp;quot;DESTRUCTIVE&amp;quot;&lt;br /&gt;
),&lt;br /&gt;
a!buttonWidgetSubmit(&lt;br /&gt;
label: &amp;quot;Update&amp;quot;,&lt;br /&gt;
saveInto: rule!UpdateEvent(&lt;br /&gt;
ri!Event,&lt;br /&gt;
fv!result,&lt;br /&gt;
fv!error&lt;br /&gt;
),&lt;br /&gt;
style: &amp;quot;PRIMARY&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
},&lt;br /&gt;
align: &amp;quot;START&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
},&lt;br /&gt;
showWhen: not(&lt;br /&gt;
isnull(&lt;br /&gt;
local!selectedEventId&lt;br /&gt;
)&lt;br /&gt;
)&lt;br /&gt;
)&lt;br /&gt;
)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>