Support Topics Documentation Slack YouTube Blog

How to save row with relation with one request to backendless server

hi
i use of flutter but its not exist in category , btw

i use of this code to save row with its relation , but server not save relation

Map<String,dynamic> productMap = new Map();
productMap["___class"]="ProductTable";
productMap["name"]="pizza";

Map<String,dynamic> orderMap = new Map();
orderMap["product"] = productMap;
orderMap["mobile"] = txtmobile
orderMap["address"] = txtAddress;

var response = await Backendless.Data.of("OrderTable").save(orderMap);

Hi Hamid,

Creating a relation in Backendless is a separate API (see the setRelation and addRelation methods in Backendless.Data.of( "tableName" )). It requires both the parent and children objects to already exist in the database.

Regards,
Mark

1 Like