Skip to content

$fn.updateUser(param)

Update the application’s authenticated users. "asynchronous"

Arguments

NameTypeDescription
paramobjectUser information to update

param details

PropertyTypeDescription
originalEmailstringEmail(before update)
emailstringEmail(after update)
namestringName
enabledbooleantrue: Enabled
false: Disabled
Default is true
custom_01stringCustom Attribute 1
custom_02stringCustom Attribute 2
custom_03stringCustom Attribute 3
custom_04stringCustom Attribute 4
custom_05stringCustom Attribute 5
custom_06stringCustom Attribute 6
custom_07stringCustom Attribute 7
custom_08stringCustom Attribute 8
custom_09stringCustom Attribute 9
custom_10stringCustom Attribute 10

Return value

TypeDescription
Promise<User>Updated user information
ObjectPropertyTypeDescription
UseruserIdstringUser ID (GUID)
emailstringEmail
namestringName
custom_01stringCustom Attribute 1
custom_02stringCustom Attribute 2
custom_03stringCustom Attribute 3
custom_04stringCustom Attribute 4
custom_05stringCustom Attribute 5
custom_06stringCustom Attribute 6
custom_07stringCustom Attribute 7
custom_08stringCustom Attribute 8
custom_09stringCustom Attribute 9
custom_10stringCustom Attribute 10
enabledbooleanEnable/Disable
createdstringCreation date and time
updatedstringUpdate date and time
statusstringUser Status

Sample

try {
/* CSV content
* ---------------------------------------------------------
* "originalEmail","email","name","enabled"
* "user01@test.co.jp","user01@test.co.jp","User01",ture
* "user02@test.co.jp","user02@test.co.jp","User02",false
* ---------------------------------------------------------
*/
const file = await $fn.getFile('/updateUserInfo.csv');
const buffer = file.data;
const userInfos = $fn.csvToObject(buffer);
for (let userInfo of userInfos) {
let data = {};
data = {
originalEmail: userInfo['originalEmail'],
email: userInfo['email'],
name: userInfo['name'],
enabled: JSON.parse(userInfo['enabled'])
};
// Update User
const result = await $fn.updateUser(data);
}
} catch(err) {
console.log("Error", err);
}