Support Topics Documentation Slack YouTube Blog

Relating object in different table to users table

How do I relate a column in a different table to users table and getting the users Id without using console.

Hi @Yomade_Stephens,

have you read this docs?
https://backendless.com/docs/android/data_relations.html

There is an API description on how to do it.

Regards,
Stanislaw

Can u shed a little light I am bit confused with that api.

Can you ask specific questions with reference to the docs? For example, “I do not understand what X, Y and Z mean” (substitute X, Y and Z).

I want to get a user Id (not the current user logged in). And show/ relate it to a different table on a column “guest_user”

So you want to relate a user object from the Users table to another object in another table? What is the name of the other table?

Following

Do you know what other object(s) in the Following table the user will be related with? Can you identify those objects with a query?

Guest_id. That’s all

Where “ownerid = ’ " +guest_id+”’".

That’s not what I am asking…

You have an object in the Users table. You want that object to have a relation with some other objects in the Following table. My question is: what are those other objects? You need to be able to identify them with a query.

Ok, now, do you know how to retrieve the User object? The one which the relation will be established for.

No.

That where I need help

So you need help with understanding how to retrieve an object from the Users table?

Yh

Retrieving the users id to be exact. Or let say making a relation to a certain user.

Does the app know objectId of the user you need to retrieve?

Yes it does

Ok, good. Do you use Android, iOS or JS?