<?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>update a value at the current index then increment at other indexes</title><link>https://community.appian.com/discussions/f/new-to-appian/34137/update-a-value-at-the-current-index-then-increment-at-other-indexes</link><description>Hi, In foreach loop I am fetching some value. So the requirement is at current index of foreach loop I am updating some default value and then at the proceeding indexes i want to increment by one in the default value. Here is how I am doing it. 
 
 What</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: update a value at the current index then increment at other indexes</title><link>https://community.appian.com/thread/130005?ContentTypeID=1</link><pubDate>Fri, 23 Feb 2024 10:02:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c216aba9-9c1c-4148-9a18-43b1058739db</guid><dc:creator>Sadia_Rashid</dc:creator><description>&lt;p&gt;it worked thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: update a value at the current index then increment at other indexes</title><link>https://community.appian.com/thread/129998?ContentTypeID=1</link><pubDate>Fri, 23 Feb 2024 08:33:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:45094aeb-cc7e-42cd-a775-b04b577b3bf8</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Try this&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!forEach(
  items: local!rawData_at,
  expression: a!update(
    fv!item,
    &amp;quot;KeyTaskModel&amp;quot;,
    (fv!index - 1) + fv!KeyTaskModel_StartingOrder_int
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: update a value at the current index then increment at other indexes</title><link>https://community.appian.com/thread/129997?ContentTypeID=1</link><pubDate>Fri, 23 Feb 2024 08:26:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:65668d5a-1927-48cf-91e1-8c862ec4538e</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;Could you post here the expected output please?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: update a value at the current index then increment at other indexes</title><link>https://community.appian.com/thread/129995?ContentTypeID=1</link><pubDate>Fri, 23 Feb 2024 07:30:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4430fd28-6ada-4779-9d48-b2c347e5503b</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;What exactly do you mean with this?&lt;/p&gt;
[quote userid="105941" url="~/discussions/f/new-to-appian/34137/update-a-value-at-the-current-index-then-increment-at-other-indexes"]but the subsequent indexes is adding value to the index value not the rule input value[/quote]
&lt;p&gt;In an expression, you cannot add anything to a rule input. The only thing an expression can do, is to take some input values, and generate an output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>