Hi There,
Could you pls help me with the next;
What I am trying to achieve in the Angular / Bootstrap builder is the following;
I use "Users" collection to store userIDs as normal
I have a local storage variable, in which I store the current userID (var currentuser = Apperyio.User.getUserId(); localStorage.setItem("currentuserlocal", JSON.stringify(currentuser));)
I have a collection for storing Organizations. In there I have a pointer field, which refers to the "Users" collection
I want to create a new record
As a try if I set the scope with a discrete value it works perfectly;
$scope.Org_to_Create.Org_Last_Modified_by_USERID = {"id":"562673f1e4b074527e208c3a","collName":"users"};But when I try with the local storage it does not add the record at all. I have tried the following variations. None of them works;
$scope.Org_to_Create.Org_Last_Modified_by_USERID = {"id":"'+currentuserlocal+'","collName":"users"};
$scope.Org_to_Create.Org_Last_Modified_by_USERID = {"collName":"users", "id":'+localStorage.getItem("currentuserlocal")+'}
Could you please let me know the solution?
Thanks,
Peter