S3 Trigger on Lambda Function not working for Amazon Connect to Salesforce Reports

0

I recently set up a test instance of Amazon Connect and set up an integration with a Salesforce sandbox. As per instructions (see link below) I set up a Lambda application and functions. I tested and validated the basic lambda functions such as Contact lookup and Case create. I then set up Amazon Connect reports and scheduled them to run every 15 minutes. These reports generate correctly and are saved in the S3 bucket.

I then set up an S3 trigger in the SFIntervalQueue function, as per instructions, so that whenever a csv file was generated the report should be pushed into the Salesforce sandbox. I have done this for historical metrics so far,, not realtime metrics. This is not working. The report in Salesforce is never updated with new data even when I put calls into the test AC instance. It the Lambda management console on the function, if I look in monitoring, it seems that the function is never invoked, so maybe the trigger is never being fired.

Furthermore, in the instructions there is an "Enable Trigger" checkbox on the trigger setup page, but I do not see this. Am I missing something or is this just a version difference?

Any help would be appreciated! https://github.com/amazon-connect/amazon-connect-salesforce-cti/blob/v5.7/lightning/04%20Configuring%20and%20Using%20AWS%20Serverless%20Application%20Repository%20for%20Salesforce%20Features/02%20Amazon%20Connect%20Historical%20Metrics%20in%20Salesforce.md#amazon-connect-historical-metrics-in-salesforce

EDIT: So I have managed to get the trigger to run. The prefix was the issue, I had wrongly put in the Bucket Name before the rest of the path. Now I am getting this error in the lambda function logs when it tries to push the report into Salesforce: INVALID_FIELD: No such column 'amazonconnect__Adherence__c' on sobject of type amazonconnect__AC_HistoricalQueueMetrics__c

I have looked and no such field exists in the SF object. I have unticked the field in the metric tab in the reports in the Amazon Connect portal and it is still included in the report columns. How can I remove this field from the sfIntervalQueue and sfIntervalAgent report?

2 Answers
0
Accepted Answer

I found that the report setup in Amazon Connect portal had automatically been set to "Agent" in the Metrics tab when it should have been Contact. I set it to contact, clicked "Apply" and then clicked "Save Report" (don't skip this) and it worked. BTW thanks for looking this over Clarence!

answered 10 months ago
0

So I have managed to get the trigger to run. The prefix was the issue, I had wrongly put in the Bucket Name before the rest of the path. Now I am getting this error in the lambda function logs when it tries to push the report into Salesforce: INVALID_FIELD: No such column 'amazonconnect__Adherence__c' on sobject of type amazonconnect__AC_HistoricalQueueMetrics__c

I have looked and no such field exists in the SF object. I have unticked the field in the metric tab in the reports in the Amazon Connect portal and it is still included in the report columns. How can I remove this field from the sfIntervalQueue and sfIntervalAgent report?

answered 10 months ago
  • have you try to schedule the report again? Best thing to do is delete the save report, recreate and reschedule specifying the proper prefix. Check in your S3 location for the CSV file to confirm. And you might need to either manually modified the already existing reports, or simply delete them in S3.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions