You are viewing limited content. For full access, please sign in.

Question

Question

How to skip task if submitter is in a certain role in FORMS?

asked on March 5, 2024

This seems easy but my brain hurts. I have a group of directors that approve other requests for their departments. I'd like to add them to the director role. That way, if they submit a request for their department, it skips the approval task and moves on down the line.  How can I set this up from an exclusive gateway where:

Process Initiator = ValueOf[Role(Director)]     ....   This is made up pseudo code btw but how I'm thinking of it for the pathway from the gateway.

 

I'd rather not build a table lookup with hidden fields as all that information seems to be here already and would have to be managed with hiring/separation/promotion events.  This way it's a one stop shop to add them to the director role and move on.

Thanks in advance to anyone with any insight on this one!

0 0

Replies

replied on March 5, 2024

This isn't exactly what you're asking, but may help.

We don't have users setup in Team Roles for this purpose, but we do have some external tables with lists of users in roles. As an example, we have a table listing all Fiscal Officers, and use that in our Forms Lookups.

Something like this:

When Current User (pulled into a hidden field) matches Name field in Fiscal Officer table, 
populate different hidden field with 1 (or TRUE or YES or Match or whatever you want).

We then use the value in that second hidden field for all of our logic in Field Rules and Gateways.

I hope that helps!

2 0
replied on March 5, 2024

Thank you for this. I'm trying to avoid external tables as LF Forms already creates tables for Teams, Team Roles, ect. and should be able to handle this somehow without having to manage additional tables.

Thank you for taking the time to reply, though. 😊

0 0
replied on March 5, 2024

I dont think the exclusive gateways have a selection to route by the role that was pulled from the team on the last step.  I do what Jennifer does either with SQL or with a function on a hidden field so I can assign "tiers" to roles.

0 0
replied on March 5, 2024 • Show version history

I added a custom view to my LFForm database that gives me a simplified list of users and their team and role assignments.  Then I can use that with processing like @████████explained.  Do a lookup on the form based on the current user to see if they have a particular team and role assignment, and use that to dictate field rules or Javascript that changes how the form works.  For example, make fields show on the form to allow populating approval fields at initial submission if the user has the Director role or hide them otherwise.  Then a Gateway later in the process only processes the approval task if the approval field(s) are not already complete.

Here's the query I used for the custom view (which I named active_team_role_members): 

SELECT        t.id AS team_id, r.id AS role_id, t.name AS team_name, r.name AS role_name, t.description AS team_description, r.description AS role_description, u.username, u.displayname, u.email
FROM            dbo.team_members AS tm LEFT OUTER JOIN
                         dbo.teams AS t ON t.id = tm.team_id LEFT OUTER JOIN
                         dbo.cf_users AS u ON u.user_id = tm.user_group_id LEFT OUTER JOIN
                         dbo.team_roles AS r ON r.team_id = t.id LEFT OUTER JOIN
                         dbo.team_member_team_role_mapping AS trm ON trm.team_member_id = tm.id AND trm.team_role_id = r.id
WHERE        (tm.leave_date IS NULL) AND (t.is_deleted = 0) AND (tm.member_rights <> 0) AND (trm.team_role_id IS NOT NULL)

 

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.