Page 3 of 4

UPDATE some columns (ie PATCH)

Posted: Wed Oct 05, 2016 7:40 pm
by Evgene Karachevtsev

Hello Steven,

Unfortunately this issue is still in progress. We'll post an update as soon as it will be fixed.


UPDATE some columns (ie PATCH)

Posted: Wed Oct 05, 2016 9:16 pm
by leven.steve

How about if I change the page JS code to call a server side script and pass it parameters of id, column name and new value can the server-side script update one column?

Example:
updateTimeSheet({"id":"xxxxxxxxxxxx","colName":"rate";"newValue":100});

and then have the server-side script do something like:
var _id=request.id;
var col=request.colName;
var newValue=request.newValue;

result.obj = Collection.updateObject(dbId, "Timesheet",_id,{col:newValue});

Would that work?


UPDATE some columns (ie PATCH)

Posted: Fri Oct 07, 2016 11:49 am
by Serhii Kulibaba

Hello Steve,

No, it won't work. Please look at the Server Code below for that functionality:

prevar _id = request.get("id");
var col = request.get("colName");
var newValue=request.get("newValue");
var newObject = {};

newObject[col] = newValue;

result.obj = Collection.updateObject(dbId, "Timesheet", _id, newObject); /pre


UPDATE some columns (ie PATCH)

Posted: Fri Oct 07, 2016 12:14 pm
by leven.steve

Thanks Sergiy. I figured it would be the case to use server code and no doubt in time I will make all requests via server code.

I have already used something like this to update a password in the Users file so I know it will now work.


UPDATE some columns (ie PATCH)

Posted: Tue Oct 11, 2016 9:57 pm
by Illya Stepanov

Here is an update about the topic issue:

As a workaround you can use REST API ($http) invocation in AngularJS for your update service but it should be configured manually and it can't be used for our platform predefined services:
https://docs.appery.io/docs/appbuilde...


UPDATE some columns (ie PATCH)

Posted: Wed Oct 12, 2016 6:28 am
by leven.steve

Thanks IIlya, I will look at that.
It may have been a little more helpful if you guys gave me that answer and link 3 months ago though!


UPDATE some columns (ie PATCH)

Posted: Sat Jan 18, 2020 3:54 am
by Michael Ochakovsky

How can I pass input box data to server code?

Let's say that I want my user to update his email address or phone number on record. I navigate the user to an update page with input boxes for each of the records in the collection.

The user enters,,, e.g. a new phone number; leaves the rest of the fields blank, because user only needs to update the email record.

how to I accomplish this by pressing the update data button..

Note: I am using a jquery app

Thanks


UPDATE some columns (ie PATCH)

Posted: Sun Jan 19, 2020 11:26 pm
by Michael Ochakovsky

I got this to work thanks to Serhii. I am next trying go find a method for updating all profile related data. I am hoping that Serhii is assigned to help me with this new challenge also; Serhii is the man!

Mike


UPDATE some columns (ie PATCH)

Posted: Tue Jan 21, 2020 8:30 pm
by Serhii Kulibaba

Please use a simple mapping from your input component to the request parameter of the Server Code, which has to get this value: https://docs.appery.io/docs/appbuilde...


UPDATE some columns (ie PATCH)

Posted: Wed Jan 22, 2020 1:32 am
by Michael Ochakovsky

Thanks Serhii, but I do not have a server code for the update. will something like this work:

var dbApiKey = "myDBKey";
var result = Collection.updateObject(dbApiKey, "UserProfile", "_id", {
"email_address": "a href="mailto:user1@myapp.com" rel="nofollow"user1@myapp.com/a",
"phone_number": "111-222-3333",
"accunt_recovery_code":"1777",
"post_address":"301 elm street, MA 10023"
});
I'd like to be able to update as many fields as the users needs to update from inside the server code.

I tried mapping but it did not work for me.

Thanks

Mike