Hi Team,
We have requirement where we are exposing an Appian Process as a webapi. This Process has one user input task which are required to be attended by certain set of stakeholders. The stakeholder information comes from the API as a payload. These Stakeholders can be Groups or Users. Is there a function to convert user and group text to Appian Users/Groups? There is no order in which we will get users/groups i.e. the payload can define comma separated Group/User names. Also, there can be a scenario where we have only a Group/ a user defined.
Discussion posts and replies are publicly visible
Hi,
Create an expression rule which as one parameter (TEXT),
pass all the UsergroupName on the rule,
use Split function
local!AllUserorGroup: split(ri!Input,",")
you get the array on the variable local!AllUserorGroup
use apply function
pass all the array one by one
create another rule called : Get_UserOrGroup(<Text>)
apply(
rule!Get_UserOrGroup,
local!AllUserorGroup
)
Expression for the rule Get_UserOrGroup is mention below
/*Rule Get_UserOrGroup Input: UserOrGroup, Type- Text */ =with( if( IsUsernameTaken( ri!UserOrGroup ), touser(ri!UserOrGroup), getgroupbyname( ri!UserOrGroup ) ) )