Conditional Login actions?

Hi all,

I’ve had a good search on the forum but not found a similar question answered. I have two user types, let’s call them ‘job posters’ and ‘workers’. I have a single login page, and I would like to know if there’s a way that upon pressing login, the ‘job posters’ can be directed to one dashboard, and the ‘users’ another.

All users have a “user type” field which separates them, however I’m unsure how to get the login button to recognise this. The furthest I have gotten is for the login button to log the user in, then send to ‘job poster dashboard’ “ONLY WHEN” user type = job poster. However, there doesn’t seem to be an ‘else’ function? I tried adding an action after it in the work flow to do the same to user type = installer, but it seems that if the criteria isn’t met for the first action, it doesn’t continue but just stops.

tl:dr how do I send users to different dashboards from the login button based on ‘user types’?

Any help would be really appreciated.

Thanks!

Ed

You pretty much have got it. Just have a separate workflow for each user type. So, “only when user type is admin” go to the page you need. Then have another workflow “only when user type is installer” go to installer page. Just do this for all user types.

Can you show a screenshot of your workflow setup? The way you described it is exactly how I do it on my apps, so I’m sure it’s just something simple that’s misconfigured.

Thanks for your quick reply Andrew, Below is the screenshot of the workflow. After login, step 2 redirects to “job poster dashboard” if the user is a “job poster” which works fine, but if the user is a ‘worker’, it will not continue past this step to step 3, but just does nothing.

Any idea what I’m getting wrong here?

Thanks again

Ed

Thanks for your quick reply, J. Can you add two workflows to one button? I can only see to add another step within one workflow, not add another workflow to that element. Have I understood your answer right?

Thanks again

Ed

Sorry I meant separate actions within a workflow. What you have done looks the same as mine which works. This is screenshots of my setup if this helps.
image
image
image
image

The thing that I would check: Is the spelling and capitalization the same everywhere?

Hello. You can add 2 workflows from the same button. Create your first workflow like this:
-Button login is clicked
Set the condition on the workflow itself, rather than the actions under the workflow. Like this:
-button login is clicked and current users ROLE is “worker”
Action to perform–>Navigate to page “worker dashboard”

Now, copy and paste this workflow. Change the condition on this workflow to:
-button login is clicked AND current users ROLE is “job poster”
Action to perform–>navigate to page job_poster_dashboard.

I hope that is clear enough. I’m not in a position to upload screenshots right now.

Edit: screenshots

1 Like

This turned out to be the answer, thanks very much for the clear explanation, you’ve just saved me a headache!

All the best

Ed

Thanks a lot J, my fault for misunderstanding!

cheers

Ed

Very welcome. I’m glad this helped you keep moving!

@edwardfrost037 i had a similar situation but I have three types of user accounts sellers, buyers and admins

I set them all up as users but all i did was add a field in the DB Users for Administrator = YES / NO Buyer = Yes/No or seller yes/no then added these into the work flows

so if User logins in then dependant if admin take them x, if a seller take them y and if a buyer take them z pages

Hope that makes sense

Please explain “ROLE” on your workflow example? Can this workflow be adapted for a new user that has been referred to a landing page from an existing user?

Thanks!

ROLE is just a field on the user type in this example. The role could be anything. An administrator, manager, job poster, etc. This is just one way of sending users to different pages based on their use case for the app. You could also have it be a yes/no, like Admin is Yes, etc. I suppose it could be used for letting a user access a certain page by invitation or something, if that’s what you’re thinking.

Ahh, OK. I have a different issue where a user is directed to a page by an existing user. So, they are not different types, only a new user who must signup to compete a referral action.

This topic was automatically closed after 70 days. New replies are no longer allowed.