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
10 replies
Subscribers
7 subscribers
Views
3485 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
In our existing Appian user accounts, we have duplicated users with the same emp
Will Teoh
over 11 years ago
In our existing Appian user accounts, we have duplicated users with the same employeeID (set as customField1). I have to do housekeeping to deactivate the duplicated user accounts based on the duplicated employeeID. What is the best way to do it?
I have looked at intersection, union, wherecontains, contains, distinct... But I have no idea how to implement any of these function to achieve my objective. Any ideas?
Thanks!
...
OriginalPostID-79642
OriginalPostID-79642
Discussion posts and replies are publicly visible
0
Sathya Srinivasan
Appian Employee
over 11 years ago
Is this one user of lots of users? The user-id is the main field used to identify a user in Appian. I'd like to how how customField1 comes into play in your case.
In general, if you're in Appian 7.x, you can write a process that looks into all members of groups 'All Users' and reads their property and does whatever action you want to perform. In prior versions, create a group and set the membership based on rule where email contains @. That should include all the users.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Will Teoh
over 11 years ago
@sathya.srinivasan We synced our users into Appian from our Active Directory. That explains why we are not using the id of the user in Appian as the unique identifier. I have no probelm getting the list of users in Appian, but I do have a problem detecting duplicated accounts AND deactivating them. Any idea how I can achieve this?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Michael Tan
Appian Employee
over 11 years ago
Will, you can create a series of rules which will detect whether your employeeID is duplicated. I can send you an application if you would like, but I will try to post as much here as possible:
I have rule!checkIfIndexEqualToValue -- index(ri!textArray,ri!index,{})=ri!value
textArray can be your array of employeeID's (perhaps it is an integer)
I pass this in to another rule isValueDuplicated:
=if(sum(tointeger(apply(rule!checkIfIndexEqualToValue,ldrop(append(enumerate(length(ri!textArray)),length(ri!textArray)),1),ri!textArray,ri!value)))>1,ri!value,{})
This returns the value if it is duplicated or an empty set otherwise. Finally, this rule is passed to another rule:
rule!whichItemsAreDuplicated: =apply(rule!isValueDuplicated,union(ri!textArray,ri!textArray),ri!textArray)
Pass in your array of employeeId's and it indicates which ones are duplicated. This will give you the list which you can then go back and deactivate users with.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Will Teoh
over 11 years ago
@michael.tan thanks for your reply. I am still looking into this as I havent fix the issue yet. My employee IDs have leading zeros, thus it is in text. I saw you have a sum function in your rule. any diff if im passing in a text datatype?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Will Teoh
over 11 years ago
I can't get the rule to run Michael... I have set ri!textArray as type Text (multi), ri!index as type integer (single), and ri!value as type Text (single).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Michael Tan
Appian Employee
over 11 years ago
Hi Will, the fat that you are using text is fine. The tointeger and sum functions are used to convert the Booleans returned to numbers. Here is a sample application. I suspect the issue you ran in to is that when creating the rules the order of the inputs matter, as you are passing them in to the looping functions. Hope the application will clear things up.
http://ap.pn/1blbkKV
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Michael Tan
Appian Employee
over 11 years ago
fact*
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Will Teoh
over 11 years ago
Hi Michael, your application package couldn't be imported.
Problems (1):
content _a-0000d827-0d26-8000-4594-010000010000_1307 "checkIfIndexEqualToValue": An error occurred while creating content [uuid=_a-0000d827-0d26-8000-4594-010000010000_1307]: Name is insufficiently unique (APNX-1-4071-007)
Cascading Problems (3):
content _a-0000d827-0d26-8000-4594-010000010000_1308 "isValueDuplicated": The content [id= uuid=_a-0000d827-0d26-8000-4594-010000010000_1308] was not imported because a required reference is missing: Reference to content [_a-0000d827-0d26-8000-4594-010000010000_1307] (Content > Free-form Rule) cannot be found. (APNX-1-4070-001) (APNX-1-4071-006)
content _a-0000d827-0d26-8000-4594-010000010000_1311 "whichItemsAreDuplicated": The content [id= uuid=_a-0000d827-0d26-8000-4594-010000010000_1311] was not imported because a required reference is missing: Reference to content [_a-0000d827-0d26-8000-4594-010000010000_1308] (Content > Free-form Rule) cannot be found. (APNX-1-4070-001) (APNX-1-4071-006)
processModel 0003d827-18d9-8000-4595-010000010000 "{en_US=Show Duplication Rules}": The processModel [id= uuid=0003d827-18d9-8000-4595-010000010000] was not imported because a required reference is missing: Reference to content [_a-0000d827-0d26-8000-4594-010000010000_1311] (Process Model Expressions (Rules)) cannot be found. (APNX-1-4070-001) (APNX-1-4071-006)
Success (3):
content _a-0000d827-0d26-8000-4594-010000010000_1306 359 "Testing"
processModelFolder _g-0000d827-0d28-8000-4595-010000010000_4 19 "Testing"
application _a-0000d827-0d26-8000-4594-010000010000_1314 360 "Duplication Test"
Hmmm....
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Will Teoh
over 11 years ago
My bad. forgotten that I have created the rules with the same name as yours...HA HA!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Michael Tan
Appian Employee
over 11 years ago
Thought that might be the case. Please let me know if you have any further questions.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel