What's the difference between an array and a set in Appian?

When looking at the list of available functions I see there is a list for array and one for set. I've been working with appian for a bit but I seem to use both list of functions for any array type, whether it is a list of CDTs or a list of numbers.

So, could someone explain to me what the set data type is and how it differs from an array?

If it's been asked already please send me a link. I was unable to find an answer for this when searching the site.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi   as per my understanding, there is a difference between array and set in Appian.

    1. Set or Set functions doesn't allow duplicate values in Appian as well as in Java.

    Whereas array allows duplicate values.

    Example: assume I have a variable local!data: {10,20}

     

     

    Array function example
    
    -------------------------------------
    
    append (local!data, local!data) -> {10, 20, 10, 20}

     

    Set function example
    
    -------------------------------------
    
    union(local!data, local!data) -> {10, 20}

    Hope this helps.

Reply
  • 0
    Certified Lead Developer

    Hi   as per my understanding, there is a difference between array and set in Appian.

    1. Set or Set functions doesn't allow duplicate values in Appian as well as in Java.

    Whereas array allows duplicate values.

    Example: assume I have a variable local!data: {10,20}

     

     

    Array function example
    
    -------------------------------------
    
    append (local!data, local!data) -> {10, 20, 10, 20}

     

    Set function example
    
    -------------------------------------
    
    union(local!data, local!data) -> {10, 20}

    Hope this helps.

Children
No Data