new / improved action tools

By J. on 21 May 2010

What I like to see:

switch
to be able to set the labels of the conditions instead of seeing 1,2,3,4 and otherwise

do/while/do or  for-loop
I really would like to see a simple do/while on a condition, instead of a cumbersome if statement. the "cycle" note is a nifty feature with it.
wether is should be a for-loop with just an integer or a do/while I don't mind.
except for esthetics perhaps, because I don't like "breaking" out of a for-loop


Gary McKay25 May 2010

Yeah, I agree an Do/While or For Loop would be good.

I would love to see perhaps even a Do CASE Statement:

DO CASE
     CASE <lCondition1>
        <statements>...
     [CASE <lCondition2>]
        <statements>...
     [OTHERWISE]
        <statements>...
     END[CASE]


Case could be possible with a switch but a do-while would be a great one!
When are we going to get these?

I've been asking for them since version 3.1 (or even earlier...)

Sure, most of the time the for-each loop works but sometimes the solution just looks wierd and would be *a lot* simpler -- read: lower maintenance -- with a for loop.

Merged from 'For loops' (idea created on 2010-06-08 10:28:46 by Carlos Fonseca), on 2010-07-08 16:26:14 by Paulo Tavares
J.14 Jun 2010
Isn't this simlar to this idea http://www.outsystems.com/wisdomofthecrowds/IdeaComment_List.aspx?IdeaId=173 ?


Merged from 'For loops' (idea created on 2010-06-08 10:28:46 by Carlos Fonseca), on 2010-07-08 16:26:14 by Paulo Tavares
Tiago Bernardo6 Aug 2013
Right now I need to transverse a record list _backword_ and a "for each, backword" action tool would come very handy.
Or a "for-loop".
Justin James13 Feb 2015
Because using an If statement is an easy way to create an infinite loop by mistake.

J.Ja


Merged from 'While loop in Actions' (idea created on 2015-02-13 16:01:13 by Justin James), on 2017-08-20 14:08:04 by Justin James
J.16 Feb 2015
yes, very much needed.



Merged from 'While loop in Actions' (idea created on 2015-02-13 16:01:13 by Justin James), on 2017-08-20 14:08:04 by Justin James
J.17 Feb 2015
On that note, it's been proposed very often in similar matters

http://www.outsystems.com/ideas/173/new-improved-action-tools
http://www.outsystems.com/ideas/965/for
http://www.outsystems.com/ideas/730/enhanced-for-each
http://www.outsystems.com/ideas/1141/exit-loop
http://www.outsystems.com/ideas/776/add-break-continue-on-cycles
http://www.outsystems.com/ideas/289/detect-possible-infinite-loops-in-action-flows-and-force-the-definition-of-max-it


Merged from 'While loop in Actions' (idea created on 2015-02-13 16:01:13 by Justin James), on 2017-08-20 14:08:04 by Justin James
Justin James17 Feb 2015
Sadly I suspect I posted at least a few of those...

J.Ja


Merged from 'While loop in Actions' (idea created on 2015-02-13 16:01:13 by Justin James), on 2017-08-20 14:08:04 by Justin James
Tiago Bernardo20 Feb 2015
The first idea (http://www.outsystems.com/ideas/173/new-improved-action-tools) has been proposed in 2010... how come it only has 16 likes (me included)?... Perhaps most outsystems developers don't feel the need of these tool action elements...
Indeed more tool action elements would leave the platform more expressive to code but also less "simpler".

I believe just the existence of a tool action element for a FOR loop, with a initialization, condition, and increment, would be suficient to handle most situations.

Merged from 'While loop in Actions' (idea created on 2015-02-13 16:01:13 by Justin James), on 2017-08-20 14:08:04 by Justin James
J.23 Feb 2015
True,

imho, if you only create webpages and use sql propely there is almost no need for special for-loops.
However, when you are creating more batch-processing, converts and other BackOffice processes, the need for while-loops will increase.
In other words, it's the need for the 20% :)



Merged from 'While loop in Actions' (idea created on 2015-02-13 16:01:13 by Justin James), on 2017-08-20 14:08:04 by Justin James
Sandra Andonov5 Dec 2016

Agreed



Merged from 'While loop in Actions' (idea created on 2015-02-13 16:01:13 by Justin James), on 2017-08-20 14:08:04 by Justin James

Yes, while should be present in actions



Merged from 'While loop in Actions' (idea created on 2015-02-13 16:01:13 by Justin James), on 2017-08-20 14:08:04 by Justin James

I know using a For Each widget covers the majority of cases where a loop-like behaviour is needed, and I have already used some kind of counter based systems with an if widget when I need to have an action do a cycle for some reason, but it always seemed a bit of a stretch to create a local variable, increment it and have it jump out the cycle when the iteration condition is met. 

is it possible to implement a while-like widget?

Regards,

Ângelo



Merged from 'Implement a "while-like" widget' (idea created on 2017-11-08 14:49:35 by Ângelo Sousa), on 2017-11-09 16:10:10 by Justin James

Isn't what you just described the typical implementation of a for-loop in any of the mainstream programming languages (PHP, C#, Java, JavaScript, Swift, etc...)?

The standard implementation of a "while" in any programming language isn't more than:

  1. If (condition) {
  2.   < implement your logic here >
  3.   go to 1.
  4. }

The main difference is in OutSystems you can see the "go to" (the loop!) visually as a connector back to the If tool...



Merged from 'Implement a "while-like" widget' (idea created on 2017-11-08 14:49:35 by Ângelo Sousa), on 2017-11-09 16:10:10 by Justin James

Hi Jorge

Yes I know that's what is behind a "while", which is why I was wondering if it is possible for OutSystems to implement a widget that does that logic in the background just like a ForEach does.  I realize this is nitpicking, but since the structure is always relatively the same (create a counter variable, insert if counter < end value, do the logic), I don't think it would be that hard



Merged from 'Implement a "while-like" widget' (idea created on 2017-11-08 14:49:35 by Ângelo Sousa), on 2017-11-09 16:10:10 by Justin James