Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
7 replies
Subscribers
8 subscribers
Views
3675 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hi forum. I have two arrays array1 = {1;2;2;3} array2
lincolnf454
over 11 years ago
Hi forum.
I have two arrays
array1 = {1;2;2;3}
array2 = {A;B;C;D}
I'd like to remove the duplicates from array1, so I use the union function, namely union (array1,array1). Now we have
array1 = {1;2;2;3}
array2 = {A;B;C;D}
array3 = {1;2;3}
What would be the best way to associate the second value in array3 with B and C in array2? Any help would be greatly appreciated
...
OriginalPostID-86494
OriginalPostID-86494
Discussion posts and replies are publicly visible
0
Sathya Srinivasan
Appian Employee
over 11 years ago
Look into displayValue function. This might be of use to you in such scenario.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
shelzle
over 11 years ago
What exactly is your intended outcome?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Pavithra Srinivasan
over 11 years ago
You can also try something like index({"A", "B", "C", "D"}, wherecontains(2,{1,2,2,3})) or index(array2, wherecontains(array3[i],array1)) with an apply() on array3.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lincolnf454
over 11 years ago
To make it as simple as possible shelzle, in my situation array1 is a list of customers {customer1;customer2;customer2;customer3} and array2 is the data associated with these customers.
So in this case, customer1 is associated with A, customer2 is associated with B and C and customer3 is associated with D. I have to send each customer an email with their specific data. If I sent out these emails based on array1, then customer2 will get two emails, when I actually want to send customer2 one email with B and C.
This is why I created array3, but unfortunately if I send these emails based on array3, the customer2 will get one email with B.
My intended outcome is for customer1 to receive an email with A, customer2 to receive an email with B and C and customer3 to receive an email with D. I hope this all makes sense. And obviously all three of these arrays will be of variable length.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
shelzle
over 11 years ago
Did you think about building a loop in your model that iterates on array3. For each item using wherecontains and index to build a temp list of data to be sent by mail.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
revat.anandsongkit
Appian Employee
over 11 years ago
Please be aware that wherecontains() is only fully supported on 7.3.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
venkats533
over 11 years ago
you can use array1 and array2 as is in displayvalue() function. I still don't know the use of array3. Can you please post what is the actual requirement and your proposed solution ?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel