How to set up workflow that requires facebook login to post?

Hello, I’m working on this project: https://restity.bubbleapps.io/

I’m having some trouble figuring out how to specify the workflows in an efficient manner. I know what I want to be able to do in plain language, but can’t figure out the best way to implement bubble specific language.

I want people to submit ideas of what I can do with my ten dollars. The winning idea is what will happen, so I want to build in functionalty to make people share their ideas, etc.

Here’s the login

The goal is to get the user to submit ideas and vote on other ideas. Either action requires them to be logged into facebook. They can see the other ideas without being logged in.

Thus, the “add an idea” button should say a) if user if not logged in, send them to facebook login b) once they are logged in, put their idea into the database. c) give them a confirmation to let them know their idea if there.

Here’s one way I thought through the problem.

  1. User clicks add idea.
  2. If they’re not logged in, send them to a login page.
  3. After they are logged in, it will automatically post their idea, send them back to the index page with all of these
  4. An popup will post on the home page that says their idea has been posted and tell them to share it to get more votes.

I feel like I should be able to skip step 2, sending them to an entirely different page.

Is that possible? Any other ideas?

Yup I’m doing this in my app = here’s how I set it up…

Make your add button and set a visible condition for when the user is not logged in:

Second set the workflow when the user clicks this add button when you are not logged in. I found it was easiest to use the prebuilt in signup/login button that comes with the default bubble template - (why re-invent the wheel?)

So I set it’s state to signup in the workflow:

Then I display the singup/login popup:

This is what you see when you click on my add when you are not logged in:

I created a second Add button that goes a different workflow when you are logged in.
I also modified the login popup to include Facebook login/signup.

I think this is what you were looking to do - so hope it helps!

@john3 This is awesome! Thank you. I’ll work on this and let you know if I can get it to work or not.

Cool - post back any problems :slight_smile:

Also one note with the new “Only When” trigger at the bottom of the workflow boxes you could combine everything I put above into one workflow. Set one Only When for when they are not logged in and one Only When for when the are. I made mine before I knew about this.

@john3

Ok. One question, I’m having people submit data into an input field before the login/sign up. How do I deal with the posting of the input form data to the repeating group after the login is successful?

The way I understand your logic, it would work well if the user did the following.

  1. Come to the website and login
  2. Then the user is able to add dada to the to input field.

However, my workflow is.

  1. User comes to website and add’s idea to input box. If user hits submit and isn’t logged in…
  2. Login will popup and user will login.
  3. Once the user is logged in, then the data that the user put into the input field from step 1, will automatically post.

Any thoughts on this? Does the difference I’m explaining make sense?

Yes - yours is a little different and the issue is userid tracking of those who are not logged in and those who are. If you let them type something then want them to login and carry that data you have to connect the non-logged in userid to the logged in one. That’s more complexity than I wanted to deal with.

So for mine I put a rating field that they can’t click on and right below it there is a button that says signup to rate. I think you could do the same - if they aren’t logged in and click on the add idea box pop them to login first or make it grayed out for non-logged in users with a button to login right below it saying to add the idea.

Otherwise you need to figure out this non-logged in to logged in issue which there is a thread on but I thought it was more complex than I wanted to deal with:

You could set the SETSTATE for an element to keep and track the text the person entered before that person logged in. If you have more than one text entry before they log in then use several SETSTATEs. In the SETSTATE use the CUSTOME STATE to define what value you want to keep.

Lets say you are making a text input in a GROUP called input_group. Then Set State as follows:

  1. SET STATE on input_group WHERE CUSTOM STATE is user_Entry VALUE is 0 (initially)
  2. User enter a value in the field presses submit button then SET STATE > CUSTOME STATE > user_Entry = “I am a user that is entering something”.
  3. Login to Facebook
  4. After the user logs in, then use the CUSTOME STATE of the input_group called user_Entry and save it to the database.

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