Workflow action based on the value of a user field

I’m working on a marketplace and based on which type of user logs in, I want to navigate them to a different view.

For example, I have a buyer and a seller. If user logs in and the user-type is “buyer” I’d like to navigate them to the buyer dashboard (and same with the seller).

Here’s where I get stuck:

  1. Add event “User is logged in”
  2. Add an action > navigation > go to page
  3. I select the destination to be “buyers-dash” but I only want this to occur when the user type of the logged-in user is equal to “buyer”… so I do the following:
    “Only when” + “Current user” + " 's type" + “is” + then I’m stuck??

How do I reference/lookup the user’s user-type to complete the action? Any help would be greatly appreciated!

Do you have the user type saved in the database as a datafield on the user data type?

Yep - sure do, any ideas?

What type of field is the type?
If it’s text, you could do current user's type = seller (or buyer).

I’m assuming you add this somewhere during registration process?

Else you could simply have a yes/no during registration. Something like seller = yes during sign-up and use a yes/no trigger for redirect. Lots of different ways of doing this.

I also have a marketplace with a seller and a buyer, although a seller can also be a buyer and vice versa. During registration I have an onboarding process. This process asks if they want to buy or sell. If they add a company (text), the app displays certain pages and groups if current user has company.

@mattb Thanks! Yes, I add this during registration.

It is text, however I’m not seeing where I can “type = buyer”, it’s making me select an option (see below)??

Screen Shot 2020-03-08 at 11.17.26 PM

You should be able to type in the text buyer and then click somewhere outside that box.

BUT, if the OP is doing it this way (“user type” field is a string), they are doing it wrong and will regret it later (for values of later greater than about 10 minutes).

I really need to do a video on this overwhelmingly common mistake.

Like magic! (really appreciate the help)

It’s throwing this issue, any thoughts on how to mitigate this? Screen Shot 2020-03-08 at 11.25.30 PM

Nevermind, it does not throw that error if I put the condition on the action itself, not the event.

Thanks all for your help!

@keith I’d be interested in any alternative approaches. Thanks!

Yes but just offering help for particular issue. That said…

@cincidan I would agree with Keith in this circumstance. I would consider changing this before proceeding too far as it will make your life a lot easier later on. As mentioned, there a many ways of accomplishing this. For example:

  • current user is seller (text). Not great and introduces possibility of typos
  • current user is > get text from option set: better, but ott for something so simple.
  • on user, have seller which is a yes/no. Simply and elequent, with less room for typos.

It really depends on how you see your app changing in the future. For myself, multiple users can be in the same company so I have a separate comany dataset. I then use if current user company is not empty.

Ah, yes this makes sense - really appreciate the help!

1 Like