<?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>Repeat Function</title><link>https://community.appian.com/discussions/f/general/12628/repeat-function</link><description>Hi, 
 I have a list of string , like {&amp;quot;Apple&amp;quot;,&amp;quot;Orange&amp;quot;,&amp;quot;Mango&amp;quot;}. I need to repeat the string 3 times. When I give the following repeat command: 
 apply(repeat(3,_),{&amp;quot;Apple&amp;quot;,&amp;quot;Orange&amp;quot;,&amp;quot;Mango&amp;quot;}) 
 I am getting the result as {&amp;quot;Apple&amp;quot;,&amp;quot;Apple&amp;quot;,&amp;quot;Apple&amp;quot;,&amp;quot;Orange</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/84182?ContentTypeID=1</link><pubDate>Fri, 30 Jul 2021 09:38:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:63162471-8e9e-4aa7-b542-a12f2150ec9f</guid><dc:creator>gayathris111098</dc:creator><description>&lt;p&gt;you can try like this&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;repeat(length(ri!documents),ri!request.requestId)&lt;/p&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1627637819047v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/84180?ContentTypeID=1</link><pubDate>Fri, 30 Jul 2021 08:04:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:adca363e-0d5e-4a7d-81fb-47930fdf204b</guid><dc:creator>mamathak0001</dc:creator><description>&lt;p&gt;sure,&lt;/p&gt;
&lt;p&gt;I will explain my scenario, I am uploading more than 2 documents, So I want to repeat the primary key of the other table for the number of documents I am uploading (where the primary key is list ), In the same way we can add another list&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1627632226365v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/84069?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 10:16:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d02dfb6d-744e-4097-8b42-fdd00542697c</guid><dc:creator>gayathris111098</dc:creator><description>&lt;p&gt;Can you share sample outputs please?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/84068?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 08:50:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6d8c1f4a-1d40-45e9-b3f3-211cf4313369</guid><dc:creator>mamathak0001</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;my question is the same but I want to choose different fruit for each iteration, repeat it can anyone help me with this question&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/56370?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 06:42:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c430da77-1d8d-45aa-8ad5-c4fb788f0086</guid><dc:creator>Brinda</dc:creator><description>Thanks Venkatesh Suram&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/56369?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 06:42:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:52874bbc-7a3a-421e-af45-191c06c1bf21</guid><dc:creator>Brinda</dc:creator><description>Thank you Meghanaj.  It&amp;#39;s working if I make a small change to your code as follows:&lt;br /&gt;
&lt;br /&gt;
load(&lt;br /&gt;
  local!array: joinarray(&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;Apple&amp;quot;,&lt;br /&gt;
      &amp;quot;Orange&amp;quot;,&lt;br /&gt;
      &amp;quot;Mango&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;,&amp;quot;&lt;br /&gt;
  ),&lt;br /&gt;
  split(&lt;br /&gt;
    split(&lt;br /&gt;
      apply(&lt;br /&gt;
        fn!repeat(&lt;br /&gt;
          3,&lt;br /&gt;
          _&lt;br /&gt;
        ),&lt;br /&gt;
        {&lt;br /&gt;
          local!array&lt;br /&gt;
        }&lt;br /&gt;
      ),&lt;br /&gt;
      &amp;quot;,&amp;quot;&lt;br /&gt;
    ),&lt;br /&gt;
    &amp;quot;; &amp;quot;&lt;br /&gt;
  )&lt;br /&gt;
)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/56368?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 06:31:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:43f63495-9bf7-4868-8f38-d2a7d081c72c</guid><dc:creator>Brinda</dc:creator><description>Thank you Ravalik&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/56366?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 06:17:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f1a99604-05f4-48e3-88c7-7bf2d232d62f</guid><dc:creator>meghanaj0002</dc:creator><description>Hi Brinda,&lt;br /&gt;
&lt;br /&gt;
good to know that you got your ans. FYI below is also a way to do it without using foreach.&lt;br /&gt;
load(&lt;br /&gt;
  local!array: joinarray(&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;Apple&amp;quot;,&lt;br /&gt;
      &amp;quot;Orange&amp;quot;,&lt;br /&gt;
      &amp;quot;Mango&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;,&amp;quot;&lt;br /&gt;
  ),&lt;br /&gt;
  split(&lt;br /&gt;
    apply(&lt;br /&gt;
      fn!repeat(&lt;br /&gt;
        3,&lt;br /&gt;
        _&lt;br /&gt;
      ),&lt;br /&gt;
      {&lt;br /&gt;
        local!array&lt;br /&gt;
      }&lt;br /&gt;
    ),&lt;br /&gt;
    &amp;quot;,&amp;quot;&lt;br /&gt;
  )&lt;br /&gt;
)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/56365?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 05:10:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ced9ac9b-cb0f-48db-b298-22dd74e52593</guid><dc:creator>Venkatesh Suram</dc:creator><description>@brida: Can you please try with below code snippet:&lt;br /&gt;
&lt;br /&gt;
repeat(&lt;br /&gt;
  3,&lt;br /&gt;
  tostring(&lt;br /&gt;
    a!forEach(&lt;br /&gt;
      items: {&lt;br /&gt;
        &amp;quot;Apple&amp;quot;,&lt;br /&gt;
        &amp;quot;Orange&amp;quot;,&lt;br /&gt;
        &amp;quot;Mango&amp;quot;&lt;br /&gt;
      },&lt;br /&gt;
      expression: fv!item&lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/56364?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 05:04:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8d3147f7-9952-43a1-a7c0-27e55c902bcb</guid><dc:creator>ravalik</dc:creator><description>Hi Brinda,&lt;br /&gt;
&lt;br /&gt;
Please find the attached code.You can also try in this way:&lt;br /&gt;
load(&lt;br /&gt;
  local!a: {&lt;br /&gt;
    &amp;quot;Apple&amp;quot;,&lt;br /&gt;
    &amp;quot;Orange&amp;quot;,&lt;br /&gt;
    &amp;quot;Mango&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  a!flatten(&lt;br /&gt;
    a!forEach(&lt;br /&gt;
      items: enumerate(3),&lt;br /&gt;
      expression: local!a&lt;br /&gt;
          &lt;br /&gt;
      &lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
ravalik&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/56358?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 04:32:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:80943b7f-2710-4812-9695-72eb16ba05f5</guid><dc:creator>Brinda</dc:creator><description>Thank you Vimal Kumar.  It&amp;#39;s working.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/56356?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 04:28:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:363a3296-a822-4df6-9ce5-f06ed914dd46</guid><dc:creator>vimalkumars</dc:creator><description>&lt;p&gt;Hi Brinda,&lt;br /&gt; &lt;br /&gt; Try the below:&lt;br /&gt; a!flatten(&lt;br /&gt; a!forEach(&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;items: enumerate(3),&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;expression: {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;Apple&amp;quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;Orange&amp;quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;Mango&amp;quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;br /&gt; )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/56355?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 04:27:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:62ed8c51-bf70-4df0-92bc-ef659f32e722</guid><dc:creator>Brinda</dc:creator><description>It is giving the following error :&lt;br /&gt;
&amp;quot;Expression evaluation error at function &amp;#39;repeat&amp;#39;: Error evaluating function &amp;#39;repeat&amp;#39; : Cannot repeat list type&amp;quot;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Repeat Function</title><link>https://community.appian.com/thread/56354?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 04:21:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5a10660b-67f8-4575-b2a3-c9ccdf7469a8</guid><dc:creator>Mathieu Drouin</dc:creator><description>repeat(3, &lt;br /&gt;
  a!forEach(&lt;br /&gt;
    items: {&amp;quot;Apple&amp;quot;,&amp;quot;Orange&amp;quot;,&amp;quot;Mango&amp;quot;},&lt;br /&gt;
    expression: fv!item&lt;br /&gt;
  ) &lt;br /&gt;
)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>