Skip to main content
Inspiring
Mar 28, 2022 4:14 PM UTC
Question

Code

Hi All,

    I want to write the logic for the below requirement 

For example:

------------------

My Input is 1 

Output should be : {2,3,4,5}   

can  anyone share the logic 

Thanks in Advance!

    6 replies

    stefanhelzle0001
    Brainy
    Mar 28, 2022 4:18 PM UTC

    What is the purpose? Is this a test? Did you try enumerate()?

    mikes0011
    Brainy
    Mar 28, 2022 4:20 PM UTC

    What is the actual logic behind this request?   You didn't explain how your output ("{2, 3, 4, 5}") actually relates to the input of "1".  I could write an expression rule hardcoded to output {2, 3, 4, 5} no matter what input value was given, and claim it satisfies this based on the information provided here.

    The Expression Guru
    arockiaprincyv0003
    Participating Frequently
    Mar 28, 2022 7:08 PM UTC

    a!foreach(
    items:{1},
    expression:fv!item+1+enumerate(4)
    )

    andrewh0007
    Inspiring
    Mar 29, 2022 3:24 AM UTC

    As has already been said, we need may more info. If you need the proceeding X number of integers after the input number the below will work. But this is really just a stab in the dark.

    a!localVariables(
      local!inputNumber: 5,
      local!numberOfSubsequentIntegersToReturn: 4,
      1 + local!inputNumber + enumerate(local!numberOfSubsequentNumbersToReturn)
    )

    viraty527193
    Inspiring
    Mar 29, 2022 5:14 AM UTC

    [mention:eb9a70f0b32a430e8819bff3623248f0:e9ed411860ed4f2ba0265705b8793d05]

    While you post any query can you please try to be more specific with the use case so that it will be easy for other Appian users to provide better solutions catering to query more profoundly?

    just trying to keep the community clean.

    mikes0011
    Brainy
    Mar 29, 2022 4:09 PM UTC
    While you post any query can you please try to be more specific with the use case

    and also... please, please, please... no more one-word post titles (!!!)

    The Expression Guru