- Newest
- Most votes
- Most comments
Unfortunately, it's not possible to directly change the AttributeValue of an existing user proficiency from "enable" to "disable" using the UpdateUserProficiencies API in Lambda. The API requires that the proficiency with the exact AttributeName and AttributeValue combination already exists for the user.
To achieve your goal of allowing agents to dynamically select which companies they will support before signing in, you'll need to take a different approach. Here's a recommended way to implement this functionality:
-
Pre-associate both "enable" and "disable" proficiencies for each company to all agents. For example: { "AttributeName": "CompanyA", "AttributeValue": "enable", "Level": 1 }, { "AttributeName": "CompanyA", "AttributeValue": "disable", "Level": 1 }
-
When an agent wants to toggle their support for a company, use the UpdateUserProficiencies API to update the Level of the corresponding proficiency. For example:
- To enable support for CompanyA: Set the "enable" proficiency to Level 1 and the "disable" proficiency to Level 0.
- To disable support for CompanyA: Set the "enable" proficiency to Level 0 and the "disable" proficiency to Level 1.
-
In your routing logic, check for proficiencies with Level 1 to determine which companies an agent is currently supporting.
This approach allows you to effectively toggle proficiencies on and off via an external application like a web UI before login, while working within the constraints of the UpdateUserProficiencies API.
Remember to handle error cases and ensure proper security measures are in place when allowing external applications to modify user proficiencies.
Relevant content
asked a year ago
asked 2 years ago
