User A and B showing same events on calendar

When I run my calendar app and login as user A, the events created under that account show up. But when I login as user B, the same exact events also show up. How do I clear the calendar for new users? Thanks.

Hi @atroche1978 :slight_smile: If you’re ‘Doing A Search For’, then in that you can create a constraint such as Created By = Current User.

Thanks for the prompt response. So would I add this constraint to the login/signup workflows? Thanks again.

This would be just for the calendar element and the data it is displaying. So right now I’m assuming when you double-click on the calendar element itself, you have Type of Events as being an “Event” (or what you chose to name that Data Type) and then in the Data Source you are doing a Search for Events. Similar to this:

Once you click the text “Search for Events” that left-side window will appear and you will be able to add the constraint. Then when the User views that element within their browser, Bubble knows to only display Events the logged in User created.

*Or, if you’re storing the Events that the User has created in a field within the User, such as “List of Events” (Type: Event, List: Yes), then the data source would be: Current User’s List of Events (instead of “Search for Events”).

1 Like

This is going to help me a lot too. Thanks. :slight_smile:

1 Like

Awesome! No problem at all :slight_smile:

3 Likes

I will definitely give it a try and get back to you with my results. Thanks a million. :slight_smile:

Update: I entered the input as you instructed and it worked. Thanks again. :grinning:

1 Like
    One other thing. Regarding the Start time field, which has two choices, Creation date and Modified date. I initially set both end and start to Creation date and within the workflow created a thing "day time = Calendar A's current day". When the user selects any day on the calendar a group of inputs, buttons, and texts pop up. Which is used to input events and store them. Obviously. One of the texts is the result of the "day time" which displays the selected day and time. The issue at hand is when the user returns to the calendar all of the newly created data is stored on the cell which corresponds to whatever the actual day is regardless of what cell it was created for. 

    What I ended up doing was creating a new typing in "day time" in the start time field. What is happening now, all of the events are being stored in their respective days cell, but are all logging the time as 12:00am. <img src="//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/bubble/original/2X/8/8be37aeeb7b115560fe5a3eb1acd5bbab19913b4.png" width="520" height="399"><img src="//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/bubble/original/2X/2/234453be3be3dbf83212041617ba1eee65bdb6d6.png" width="690" height="443">

Hi @atroche1978 the screenshot is not showing up in the forum (if you’re on a mac, you can do command+shift+4 (take the screenshot) then command+v directly into the forum post, or just command+v any image of course :slight_smile: . Could you provide a link to your app (the editor version)?

With some trial and error I actually got it working. Thanks.

But maybe you could help with this. Say I have two different colored clickable buttons on the same page. One named ‘Night’ (grey) and the other ‘Day’ (yellow). How would I set it to navigate and send data to another page which displays a colored box that represents the button that the user clicks? I tried and tried. Example, user clicks Night, a thing is created, then navigate to next page and display a grey box titled Night. Or would I just have to create a separate navigation destination for each button? Thanks.

Sure :slight_smile: that can be done in Bubble but it’s probably best to know what the purpose is for before suggesting a way to accomplish this. Could you share the editor link? If not, what ‘thing’ is being created after a User selects a button? Does a User click a button and then is taken to page in order to complete the information of the newly created Thing, dependent on what they clicked?

Right now I’m just toying with the platform and getting used to the functions. But for sake of conversation let’s create a thing that is ‘Gender’ for a clothing store. And the types would be ‘Men’ (blue) button and ‘Women’ (red) button. Then the navigation would display a page titled ‘types’ Clothing, in corresponding color. Thanks.

Ok cool :slight_smile: There are a few ways to accomplish this – I would probably recommend keeping everything on one page and using custom states to show/hide what is visible. Here’s an example in the forum app:

Preview:

Editor:

The top repeating group uses a custom state called ‘Gender’. So when the page is loaded, the repeating group does a search for ‘Clothing’ items, and displays all clothing items (no constraints until Men’s or Women’s is clicked).

So, when the Men’s Button is clicked, the workflow sets the “Gender” state of the Repeating Group to “Men” (in the workflow this is → Element Actions → Set State, and this window will appear; I created the state Gender which is Create New State → “Gender” Type: Text, List: No)

Then in order for this to work, we need to navigate back to the UI editor and set up a conditional statement on the repeating group where we adjust the data source. Without a conditional statement on the element, just setting a custom state in the workflow doesn’t let Bubble know which parts of the display to change. In the conditional statement for when the repeating group’s custom state is “Men’s” we use the Do A Search for Clothing as the Data Source, and add the constraint ‘Gender = Men’.

Once that happens, the repeating group knows to only show clothing items with their Gender field = Men

And then we do a similar process when the Women’s Button is clicked:

Conditional formatting:

Preview:

The other option is to just have two separate pages (“mensclothing” and “womensclothing” in the forumapp). In the buttons below the repeating group, when you click you’re just navigated to those pages, and on those pages are repeating groups that automatically have the “Gender” constraint set up.

Editor for those pages:

Wow! Lot’s of info here. Thanks. This will definitely take some time. Thank you.:blush::blush::blush::blush::blush:

1 Like

Yes! Lots of info, it feels really complicated at first glance but, it will definitely become second-nature after looking over some examples! :blush:

Can a calendar have more than one data source? Or is it only restricted to one? Thanks.