$fn.updateUser(param)
Update the application’s authenticated users. "asynchronous"
Arguments
Name | Type | Description |
---|---|---|
param | object | User information to update |
param details
Property | Type | Description |
---|---|---|
originalEmail | string | Email(before update) |
string | Email(after update) | |
name | string | Name |
enabled | boolean | true: Enabled false: Disabled Default is true |
custom_01 | string | Custom Attribute 1 |
custom_02 | string | Custom Attribute 2 |
custom_03 | string | Custom Attribute 3 |
custom_04 | string | Custom Attribute 4 |
custom_05 | string | Custom Attribute 5 |
custom_06 | string | Custom Attribute 6 |
custom_07 | string | Custom Attribute 7 |
custom_08 | string | Custom Attribute 8 |
custom_09 | string | Custom Attribute 9 |
custom_10 | string | Custom Attribute 10 |
Return value
Type | Description |
---|---|
Promise<User> | Updated user information |
Object | Property | Type | Description |
---|---|---|---|
User | userId | string | User ID (GUID) |
string | |||
name | string | Name | |
custom_01 | string | Custom Attribute 1 | |
custom_02 | string | Custom Attribute 2 | |
custom_03 | string | Custom Attribute 3 | |
custom_04 | string | Custom Attribute 4 | |
custom_05 | string | Custom Attribute 5 | |
custom_06 | string | Custom Attribute 6 | |
custom_07 | string | Custom Attribute 7 | |
custom_08 | string | Custom Attribute 8 | |
custom_09 | string | Custom Attribute 9 | |
custom_10 | string | Custom Attribute 10 | |
enabled | boolean | Enable/Disable | |
created | string | Creation date and time | |
updated | string | Update date and time | |
status | string | User 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);}