<?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 dynamically implement milestone bar?</title><link>https://community.appian.com/discussions/f/user-interface/18832/how-to-dynamically-implement-milestone-bar</link><description>I have to create a milestone bar which changes it&amp;#39;s steps dynamically. 
 The resources I have is : 
 A look up table, &amp;quot;status_ref&amp;quot; containing statuses: &amp;quot;Pending&amp;quot;, &amp;quot;Approved&amp;quot;, &amp;quot;Ordered&amp;quot; and &amp;quot;Fulfilled&amp;quot; , which represent the different statuses of a request</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to dynamically implement milestone bar?</title><link>https://community.appian.com/thread/74046?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 13:43:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:71ff606d-4c35-460b-a616-1a0e5406fd6b</guid><dc:creator>varunkumarb0001</dc:creator><description>&lt;p&gt;haha... very true&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to dynamically implement milestone bar?</title><link>https://community.appian.com/thread/74045?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 13:41:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:58e85169-e41f-4368-9534-679009a31d6f</guid><dc:creator>varunkumarb0001</dc:creator><description>&lt;p&gt;Thanks Vimal, that reject fix worked.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to dynamically implement milestone bar?</title><link>https://community.appian.com/thread/74042?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 13:38:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:af4117df-dbce-47f2-a722-95773b4f5a27</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;that should work, though i&amp;#39;d consider that more of a workaround than actually fixing stuff that could probably be fixed by cleaning up the internal code &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f609.svg" title="Wink"&gt;&amp;#x1f609;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to dynamically implement milestone bar?</title><link>https://community.appian.com/thread/74041?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 13:33:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6e927c98-3002-446c-830d-6de9d9d6275d</guid><dc:creator>vimalkumars</dc:creator><description>&lt;p&gt;Hi Varun Kumar,&lt;/p&gt;
&lt;p&gt;Using the reject function to remove the null values from the milestone list can be useful&lt;/p&gt;
&lt;p&gt;Can you try the below code?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!milestoneField(
  active: - 1,
  steps: reject(
    rule!OSR_RULE_General_APN_isValueBlank,
    {
      index(
        local!statuses[1],
        /* Handling Pending */
        &amp;quot;StatusTypeName&amp;quot;,
        {}
      ),
      if(
        not(
          rule!OSR_RULE_General_APN_isValueBlank(
            local!acceptedBy
          )
        ),
        index(
          local!statuses[2],
          /* Handling Approved */
          &amp;quot;StatusTypeName&amp;quot;,
          {}
        ),
        {}
      ),
      if(
        tointeger(
          local!statusTypeID
        ) = 5,
        index(
          local!statuses[3],
          /* Handling Ordered */
          &amp;quot;StatusTypeName&amp;quot;,
          {}
        ),
        {}
      ),
      cons!OSR_TEXT_STATUS_CANCELED
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to dynamically implement milestone bar?</title><link>https://community.appian.com/thread/74040?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 13:23:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bbffcf63-6f92-405d-9528-a8f2154bbee6</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I don&amp;#39;t think your code is overtly wrong.&amp;nbsp; It looks like there&amp;#39;s a bit of buggy behavior where index() is returning a value of null() when the named property isn&amp;#39;t found, instead of the &amp;quot;default return value&amp;quot;... at least when pointing at a local variable.&lt;/p&gt;
&lt;p&gt;I think you need to rewrite the code where you refer to local!statuses[index] -- if the status array will always be basically the same, you could probably just write &lt;em&gt;local!statuses[3].StatusTypeName&lt;/em&gt;, for example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to dynamically implement milestone bar?</title><link>https://community.appian.com/thread/74038?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 13:16:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1bc8fba4-81e6-4d2e-821e-36bd9f16bce7</guid><dc:creator>varunkumarb0001</dc:creator><description>&lt;p&gt;Didn&amp;#39;t get you David. Can you please elaborate what can be vice versa in the code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to dynamically implement milestone bar?</title><link>https://community.appian.com/thread/74036?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 13:09:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c578ca40-5af2-4177-9442-6d65b756b907</guid><dc:creator>davel001150</dc:creator><description>&lt;p&gt;It could possibly be vice versa, too.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to dynamically implement milestone bar?</title><link>https://community.appian.com/thread/74035?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 13:08:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ca88e077-fa18-4a8d-81ef-10ce3a493d3f</guid><dc:creator>varunkumarb0001</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!milestoneField(
      active: - 1,
      steps: {
        index(
          local!statuses[1], /* Handling Pending */
          &amp;quot;StatusTypeName&amp;quot;,
          {}
        ),
        if(
          not(rule!OSR_RULE_General_APN_isValueBlank(local!acceptedBy)),
          index(
            local!statuses[2], /* Handling Approved */
            &amp;quot;StatusTypeName&amp;quot;,
            {}
          ),
          {}
        ),
        if(
          tointeger(
            local!statusTypeID
          ) = 5,
          index(
            local!statuses[3], /* Handling Ordered */
            &amp;quot;StatusTypeName&amp;quot;,
            {}
          ),
          {}
        ),
        cons!OSR_TEXT_STATUS_CANCELED
      }
    )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the code snippet, I&amp;#39;m using.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to dynamically implement milestone bar?</title><link>https://community.appian.com/thread/74034?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 13:04:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a30b614a-3668-4016-8390-b1c30600dec8</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I can&amp;#39;t be 100% sure without seeing your code, but my guess is you&amp;#39;ve used a &amp;quot;null()&amp;quot; somewhere instead of an empty set (&amp;quot;{}&amp;quot;) - which would create a &amp;quot;blank&amp;quot; entry on the milestone bar instead of ignoring that position.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to dynamically implement milestone bar?</title><link>https://community.appian.com/thread/74033?ContentTypeID=1</link><pubDate>Wed, 13 May 2020 12:47:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e824ef2b-fc16-4170-a889-d5138cac63ee</guid><dc:creator>varunkumarb0001</dc:creator><description>&lt;p&gt;Thanks . That worked well. But there&amp;#39;s a little UI glitch I&amp;#39;m getting, it&amp;#39;s creating extra space for null value.&lt;/p&gt;
&lt;p&gt;You can see there&amp;#39;s extra space between &amp;quot;Approved&amp;quot; and &amp;quot;Canceled&amp;quot; for local!isOrdered as false. Any way to handle this extra space.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Screenshot attached.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/8154.Capture.PNG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to dynamically implement milestone bar?</title><link>https://community.appian.com/thread/74019?ContentTypeID=1</link><pubDate>Tue, 12 May 2020 18:47:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aa23b980-4314-442e-8431-a2b240d33b59</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;The logic might get a bit complicated but you should be able to handle this using if() conditionality in the code determining the &amp;quot;&lt;strong&gt;Steps&lt;/strong&gt;&amp;quot; and &amp;quot;&lt;strong&gt;Active&lt;/strong&gt;&amp;quot; parameters in your milestone field.&amp;nbsp; I&amp;#39;ll attempt some brief pseudocode below to give a starting point for how you can do the logic tree:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;if(
  not(local!isCancelled),  /* any boolean value registering whether order was cancelled */
  
  /* non-cancelled logic: */
  a!milestoneField(
    steps: /* regular steps */
    active: /* current step */
  ),
  
  /* cancelled logic: */
  a!milestoneField(
    active: -1, /* shows all steps as completed */
    steps: {
      &amp;quot;Pending&amp;quot;,
      if(local!isApproved, &amp;quot;Approved&amp;quot;, {}),  /* show an entry for &amp;quot;approved&amp;quot; only if approved */
      if(local!isOrdered, &amp;quot;Ordered&amp;quot;, {}), /* show an entry for &amp;quot;ordered&amp;quot; only if it was ordered */
      &amp;quot;Cancelled&amp;quot;
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>