0

I have two tables which has "photo URL" columns, that contain same image URL. So when I change value in one table, I would like the value in another to update automatically. So how can I set this relationship in Backendless? Like foreign key in SQL.

EDIT: I have included Users table as property of ActionCreation table. Users have property for URL of logo for the user. In ActionCreation table I need to have exactly the same photo URL. When I included Users as property of ActionCreation, there is no custom properties are loaded form Users object. But I need access photo URL in my app. What the best way to do it? Thank you.

sermilion
  • 185
  • 1
  • 15

1 Answers1

1

Is there a relationship between the tables? How does the same value get into two tables? Do you write it there twice?

Mark

Mark Piller
  • 1,046
  • 1
  • 7
  • 6
  • You would be better of creating a relation. There are plenty of examples. Here's one: https://backendless.com/feature-1-saving-objects-with-relations/ – Mark Piller Mar 05 '15 at 16:32
  • Here's an example how to create a relation using console: https://backendless.com/feature-11-declaring-relations-between-tables-classes-using-developer-console/ – Mark Piller Mar 05 '15 at 16:32
  • Use the "Add Column" button and then select "Data Object Relationship" in the "Type" combo box. – Mark Piller Mar 07 '15 at 08:54
  • Mark, please read the question, I have updated it. This is the last thing I have to fix and I will submit the app to Ap Store hopefully) Thank you!!! – sermilion Mar 08 '15 at 13:35
  • When you say " In ActionCreation table I need to have the same photo URL." What do you mean "same"? Same as what? Also, when you say this: "When I included Users as property of ActionCreation, there is no custom properties are loaded form Users object" , you need to understand that the users object does not have custom properties, since a property is added ActionCreation. If you need Users to have a custom property, it must be declared in the Users table – Mark Piller Mar 08 '15 at 19:10
  • I wrote an article which should give you an idea how to load the data which belongs to the user: https://backendless.com/feature-60-loading-data-objects-which-belong-to-the-logged-in-user-owner-policy/ If you follow the instructions in the article precisely and apply it to your use-case, you should see the same result - a user will be loading photoUrl as a part of the ActionCreation object. – Mark Piller Mar 08 '15 at 22:48