- Newest
- Most votes
- Most comments
To retrieve and update a specific attribute in Amazon Connect Customer Profiles from a Lambda function, you can follow these steps:
-
First, use the "GetProfile" API to retrieve the existing customer profile. Although there isn't a direct get-profile CLI command, you can use the AWS SDK in your Lambda function to call this API.
-
Once you have the profile data, you can extract the existing Call Summary attribute (if present).
-
Append the new call summary along with the date to the existing summary.
-
Use the "UpdateProfile" API to update only the Call Summary attribute in the customer profile.
Here's a general approach you can use in your Lambda function:
-
Use the AWS SDK for your preferred language (e.g., Python, Node.js) in your Lambda function.
-
Call the GetProfile API, providing the necessary identifiers (e.g., ProfileId, DomainName) to retrieve the existing profile.
-
Extract the current Call Summary from the retrieved profile data.
-
Append the new call summary and date to the existing summary.
-
Use the UpdateProfile API to update only the Call Summary attribute. You'll need to provide the ProfileId, DomainName, and the updated Call Summary in the Attributes field.
This approach allows you to safely update just the Call Summary field without overwriting other attributes in the customer profile. It's important to note that you should handle cases where the profile might not exist or the Call Summary attribute is not present.
Remember to grant your Lambda function the necessary permissions to access the Customer Profiles APIs. You'll need to update the Lambda execution role to include permissions for actions like customerprofiles:GetProfile and customerprofiles:UpdateProfile.
By following this method, you can efficiently retrieve and update a specific attribute in Amazon Connect Customer Profiles from your Lambda function when a call comes in, ensuring that you're only modifying the intended data while preserving other profile information.
Sources
UpdateProfile - Amazon Connect Customer Profiles
Flow block in Amazon Connect: Customer profiles - Amazon Connect
UpdateCustomerProfile - Amazon Connect
Amazon Connect will already provide some input to the Lambda. Have a look at the following example & how to configure it: https://docs.aws.amazon.com/connect/latest/adminguide/connect-lambda-functions.html#tutorial-invokelambda
If you want to query additional information through the Lambda, I recommend using one of the SDKs. For Python "batch_get_profile" would be an option: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/customer-profiles/client/batch_get_profile.html
Relevant content
- asked a year ago
- AWS OFFICIALUpdated a year ago

But is there an GetProfile API ?