Calls
User

update

7min
this allows you to update values on fields on your applicants forms this is broadly similar to get info , except that its scope is limited to updating fields and does not include system fields (anything which starts with an underscore, such as usercart ) for adding products see add product parameters name type required description fields string, integer, or array true these are the fields present in your forms see the section "fields" for more submit forms boolean false this prevents the user's forms from submitting this is generally advised if you want to prevent the update from activating triggers that are set in your project false will prevent the forms from submitting, but true is the default example curl x post "https //www regpack com/reg/api2/users/" \\ h "content type application/json" \\ h "accept application/json" \\ h "api id 15263" \\ h "api user api admin\@regpacks com" \\ h "api token cd2e514f 7gab 3cde 62fg 51abcd4e7362" \\ d '{ "action" "update", "group id" 100909072, "clogin id" 102670541, "connected to" 102670540, "doc" { "your instrument" "piano", "will you record an album with jimi hendrix" \[ "no" ], "f 251473 6251473" "a field id looks like f 251473 6251473 by default, and has words like your instrument only when you map it" } }import requests import json users endpoint = https //www regpack com/reg/api2/users/ headers = { "content type" "application/json", "accept" "application/json", "api id" "15263", "api user" "api admin\@regpacks com", "api token" "cd2e514f 7gab 3cde 62fg 51abcd4e7362", } payload = { "action" "update", "group id" 100909072, "clogin id" 102670541, "connected to" 102670540, "doc" { "your instrument" "piano", "will you record an album with jimi hendrix" \[ "no" ], "f 251473 6251473" "a field id looks like f 251473 6251473 by default, and has words like your instrument only when you map it" } } update json = json dumps(payload) update response = requests post(url=users endpoint, data=update json, headers=headers, timeout=10) response { "msg" "user updated ", "system action" \[ "user updated" ], "success" true, "user info" { "clogin id" "102715741", "group id" "100909072", "connected to" "102715741" }, "meta info" { "u name" "jim hall", "total forms" "2", "completed forms" "0", "total user forms" "2", "total completed user forms" "0", "total user mandatory forms" "2", "total completed user mandatory forms" "0", "total order" "0 00", "total paid" "0 00", "total balance" "0 00", "status id" "0", "status name" null, "status color" null, "application date" "dec 8th 2021 17 20", "application date raw" "2021 12 08 17 20 08", "u comments" "0", "group id" "100909072", "uid" "4085257", "clogin id" "102715741", "excluded" "0", "connected to" "102715741", "total user tags" "0", "user tag ids" null, "total non excluded children" "0", "star" "0", "admin initials" null, "admin color" null, "assigned admin id" null } } validation and troubleshooting it is important to note that there are a number of behind the scenes validation actions that are occurring whenever you attempt to update a user via the api to get an overview of the basic validation options for each type of field make sure to check out the section on fields situations in which no updates occur there are three common scenarios in which an update call will be made, but no information will be updated for the user if you attempt to update a user that does not exist in the project, the system will not update any information if you attempt to update a user that does exist but the answer to the field (such as a multiple choice answer; see more below) or the field itself does not exist, then the system will not update any information finally, if you attempt to update a user who does exist but they do not have the form that contains the field you are trying to update, then the system will not update any information additional multi select validation as mentioned in the section on fields, multiple choice fields should be sent in the api as an array of strings where a single answer update is an array of length one when a string within this array is parsed, we first test whether the string matches any of the existing values within that field if no match can be found, then the html is stripped from the string, and the entire string is converted to lowercase if after this the string still doesn't match any of the values within your project, then the system would proceed to not update the value the trouble with triggers if a call is otherwise correct and you set submit forms to false , then a few specific things happen the value will save as expected, and the form on which the field exists will not submit for the user the effect this has in practice is that it prevents subsequent triggers within forms, emails, products, etc from reacting to the submission of the form this being said, if there are any fields that are triggered to show within the form itself in response to the value you are updating, then those triggers will still activate generally this is not a big deal, and the emails, products, or subsequent forms are the things you're worried about activating