<?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>Need to create a dynamic milestoneField</title><link>https://community.appian.com/discussions/f/new-to-appian/20974/need-to-create-a-dynamic-milestonefield</link><description>Hi Team, 
 I&amp;#39;m having a requirement to make the below milestone object to Dynamic. 
 Here 
 Not Assigned, InProgress, Completed are fetching from one table and Review, Rejected are fetching from another table. 
 The milestone object should be like below</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Need to create a dynamic milestoneField</title><link>https://community.appian.com/thread/81700?ContentTypeID=1</link><pubDate>Sun, 16 May 2021 09:25:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fd4f32d5-41ba-4344-b397-b1be384649ee</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Hi Harris,&lt;/p&gt;
&lt;p&gt;Please try the code snippet provided below and you should be able to generate what you are trying to do.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!stepsFromTable1: rule!getStepsFromTable().data,
  local!stepsFromTable2: rule!getStepsFromAnotherTable().data,
  local!milstoneSteps: a!forEach(
        items: {
            local!stepsFromTable1.label,
            local!stepsFromTable2.label
        },
        expression: {
            stepId: fv!index,
            stepName: fv!item
        }
    ),
  local!activeStep: 1,
  {
    a!milestoneField(
      label: &amp;quot;Milestone&amp;quot;,
      labelPosition: &amp;quot;ABOVE&amp;quot;,
      steps: local!milstoneSteps.stepName,
      links: {},
      active: local!activeStep
    )
  }
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;What I have tried to do here is get the data from two different tables and combine them in one dictionary. That way, each step has a unique if, and then you can refer to that dictionary any time if you want to see what is the name of the active step.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Harshit&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need to create a dynamic milestoneField</title><link>https://community.appian.com/thread/81697?ContentTypeID=1</link><pubDate>Sat, 15 May 2021 22:17:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1ee8ee57-ff73-4b02-af67-8d61dbf84e27</guid><dc:creator>Danny Verb</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure exactly what would cause the list to change but here is an example where you can swap out the options&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  local!isTrue: true,
  local!stepsOne: {&amp;quot;Not Assigned&amp;quot;, &amp;quot;In Progress&amp;quot;, &amp;quot;Completed&amp;quot;},
  local!stepsTwo: {&amp;quot;Not Assigned&amp;quot;, &amp;quot;In Progress&amp;quot;, &amp;quot;Review&amp;quot;, &amp;quot;Rejected&amp;quot;, &amp;quot;Completed&amp;quot;},
  {
    a!linkField(
      links: {
        a!dynamicLink(
          label: &amp;quot;Flip&amp;quot;,
          value: not(local!isTrue),
          saveInto: local!isTrue
        )
      }
    ),
    a!milestoneField(
      label: &amp;quot;Milestone&amp;quot;,
      labelPosition: &amp;quot;ABOVE&amp;quot;,
      steps: if(
        local!isTrue,
        local!stepsOne,
        local!stepsTwo
      ),
      links: {},
      active: 1
    )
  }
)
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>