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
9 subscribers
Views
9525 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Is there any function available to check if variable value is "User" or "group"?
Amir Hanif
Certified Lead Developer
over 8 years ago
Hi,
I have a variable "assignee" of "User or Group" type. I want to know if user enter "User" or "group" as an input for this variable. Is there any function available to check if variable value is "User" or "group"?
OriginalPostID-271256
Discussion posts and replies are publicly visible
Top Replies
Durgesh
over 8 years ago
+1
A Score Level 2
AFAIK there is no in-built function to verify weather it is a user or group. I think you can make a use of typeof() function to check this. This function return integer value for the type. Suppose, if…
Parents
0
snehalh
A Score Level 1
over 6 years ago
We had same requirement for a project, and I tried some solutions given here but they didn't work for me.
So here is my solution, see if it helps you:
if(find("Group",tostring(try(
togroup(ri!input),touser(ri!input))),1),"Group",
isusernametaken(tostring(ri!input)),"user","notUserorGroup")
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
snehalh
A Score Level 1
over 6 years ago
We had same requirement for a project, and I tried some solutions given here but they didn't work for me.
So here is my solution, see if it helps you:
if(find("Group",tostring(try(
togroup(ri!input),touser(ri!input))),1),"Group",
isusernametaken(tostring(ri!input)),"user","notUserorGroup")
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
0
chandu
A Score Level 2
over 6 years ago
in reply to
snehalh
Hi Sneha,
Its always good to avoid using internal functions like try(), these internal functions evaluations might be changed from one release to other release.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel