Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

enumerate

Certified Lead Developer

Another technical question on how  enumerate works. Can some one explain

index({10,30,40,50,60,70},enumerate(5),{})

returns

10; 20; 20; 30; 40

Expected out 

10; 20; 30; 40

But same works with below std code , but not sure why?

index({10,20,30,40,50,60,70},enumerate(5)+1,{})

output :

10; 20; 30; 40; 50

Syntax

enumerate(n)

Returns a list of integer numbers from 0 through n-1.
Returns: List of Number (Integer)
n (Number (Integer)): The number of integer numbers to return.

  Discussion posts and replies are publicly visible

Parents
  • Hey ganeshbabuj,

    I think you may have a typo and just wanted to clarify. You say that index({10,30,40,50,60,70},enumerate(5),{}) returns 20 but there is no 20 in the given list. Did you mean to write that index({10,20,30,40,50,60,70},enumerate(5),{}) is returning 10; 20; 20; 30; 40?

    This is the result that I got when I ran it.

    I believe it has something to do with casting {} to an integer. I replaced {} with an integer and it worked as intended. It also works with null.

    Thanks,
    Jake

Reply
  • Hey ganeshbabuj,

    I think you may have a typo and just wanted to clarify. You say that index({10,30,40,50,60,70},enumerate(5),{}) returns 20 but there is no 20 in the given list. Did you mean to write that index({10,20,30,40,50,60,70},enumerate(5),{}) is returning 10; 20; 20; 30; 40?

    This is the result that I got when I ran it.

    I believe it has something to do with casting {} to an integer. I replaced {} with an integer and it worked as intended. It also works with null.

    Thanks,
    Jake

Children
No Data