William Bradee
Posts: 0
Joined: Thu Oct 03, 2013 8:45 pm

Optional Parameters in REST

I added an email column to Users data. Now I want to update it. So I let the user update the email address. But they may not want to update the password.

How do I use the Service call to omit password if it is blank in modify settings?

Or, if I just leave it off the rest service, can I add the password attribute to the REST call with Javascript if the user wants to change it?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Optional Parameters in REST

Parameters that are not present in the request will not be updated.

William Bradee
Posts: 0
Joined: Thu Oct 03, 2013 8:45 pm

Optional Parameters in REST

yes, but if I map password from an input field, and it is blank, it is sent blank. So it is sent to the database as "".

I want to have the parameter omitted.

But I think I will create another service just to set the password and only invoke it if the password is set.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Optional Parameters in REST

I think if the parameter is there..it will get updated. It's easy to test.

William Bradee
Posts: 0
Joined: Thu Oct 03, 2013 8:45 pm

Optional Parameters in REST

The two services approach worked: One for all user parameters except password, and one for password.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Optional Parameters in REST

William,

Glad you have it working!

Return to “Issues”