How to make a "do every 5 seconds" to data type (other than user type) without creating a new thing?

Hi, everyone. My first post here.

Actually my purpose is to track a location of a user who has a thing in that data type.

Here’s the other way that I’ve tried but wasn’t success.

I’ve done a change every 5 seconds to “last location” field in a user data type. And it goes really well without creating a new thing.

But I cannot get a result of those who has a thing in another data type intersect with the last location in user data type. So I can show the requested user a list of someones who has a thing he wants and near his location. Or even display in a map.

Any solutions for either way is really appreciated.

Thanks,
S.

Hi @privilet.info :slight_smile: Welcome to the Forum! Just to confirm, you’re trying to show a list of Users that are within 0.5km of the Current User’s location? What is the other part of the search requirement? The reason the error is coming up is because the search type of content needs to be “Carders database” but the data source is combining a search for “Carders databases” and a search for Users. If it makes things easier, I’d be happy to take a look at the app editor! (You can temporarily set your app to public by going to Settings --> General --> Application Rights: Everyone can view. Then copy+paste the link in a new forum reply here)

1 Like

Thanks for a super fast reply. @fayewatson

Sorry that I can’t show you my app editor just yet, it’s all messed up at the moment.

Yes, you’re right that I want to show a list of users that are close to the current user’s location. But the ones who appear must have the right card the current user requested.

Here’s the search requirement in “Carders database”

I thought this way never work out. That’s why I wanted to try another way to get the last location in “Carders database” data type without creating a new thing. Just to make it a constant change in the field like I can do in “user” data type.

No problem! :slight_smile: Can you post a screenshot of your “Carders database” and “User” data structures?

It looks like you have two fields in the User data type: “Requested Card bank” (of type text?) and “Requested Card network” (of type text?). If so, would it be possible for you to instead have a Carders database field in the User data type?

So the field could be “Last Requested Card” (type: Carders database, list: no). (I didn’t think this was a list field since it looks like a User can only have one, “Last Requested Card”, but this may be a list if a User can have many of these)?

This way, the search would just be:

RG Type of Content: User
“Do a Search for Users”
Constraints:
“Last location is within 0.5kms of Current User’s Last Location”
“Last Requested Card = Current User’s Last Requested Card”

This may not be the solution, but I’ll definitely adjust the answer if it’s not quite there yet :slight_smile:

1 Like

Now I see what you mean.

So basically I should have all the fields in the “user” data type alone. Is it because of Bubble system cannot search across data types? If so, I now know the way to go.

Thank you so much for your help, @fayewatson

My pleasure! :slight_smile: Bubble can definitely search accross different data types, but the data source must match the type of content of the RG.

For example, let’s say you have two types: “User” and “Card”.

Each User can have many cards, and be on the lookout for many “Cards” and each “Card” can be owned or requested by many Users.

With that type of app, your data structure setup could be:

User
Fields
“Owned Cards” (type: Card, list: yes) – the Cards this User has
“Requested Cards” (type: Card, list: yes) – the Cards the User is looking for
“Last location” (type: Geographic address, list: no) – the User’s most recent location
“Trades” (type: Trade, list: yes) – the Trades a User has been a part of

Card
“Name” (type: text, list: no) – the name of the Card
“Owner Users” (type: User, list: yes) – the Users who own this Card
“Requested by Users” (type: User, list: yes) – the Users who need this Card
“Trades” (type: Trade, list: yes) – the Trades made for this Card

Trade (or Transaction)
Card 1 Trader (type: User, list: no) – the first User
Card 1 (type: Card, list: no) – the Card the first User is trading
Card 2 Trader (type: User, list: no) – the second User
Card 2 (type: Card, list: no) – the Card the second User is trading
Date of Transaction (type: date, list: no) – the date of the trade
Location of Transaction (type: geographic address, list: no) – the location where the trade was

This data structure would be pretty flexible for querying. If you’re needing to find other Users who have the card(s) that the Current User is requesting, and who are within 0.5km of the Current User, the search could be:

Type of Content: Card
Do A Search for Users’s Owned Cards
User Constraint search:

  1. Last location is within 0.5km of the Current User’s Last Location

Intersected with

Current User’s Requested Cards

The results of the repeating group would show you a list of Cards. Then, you could add another repeating group in the first cell of that repeating group which is:
“Owned by Users”. That inside repeating group type would be “User”, and the data source would be “Current cell Card’s Owner Users:filtered (constraint, last location is within 0.5km of the Current User’s location)”.

This way, you’d be shown a list of Cards that the Current User is looking for, and a list of all of the Users who own that Card, within 0.5 miles of the Current User’s last location. Is that similar to your app’s setup? :slight_smile:

1 Like

Your reply is my Eureka!!!

Thank you so much for your time and effort to type all these, @fayewatson
You’ve made this community brilliant!

:star_struck:

1 Like

Aww! Thank you so much for the kind words, @privilet.info!! :smiley: It’s my pleasure! So glad to hear it was helpful! Please let me know if any of it gives you any trouble at all, and I’ll definitely try to help make it work for sure! :sparkles:

1 Like