UiPath Studio call Salesforce QuickAction | Send email use case | Email Automation | QuickAction JSON

UiPath Studio call Salesforce QuickAction (Send email use case)

0:00 Intro
0:15 The purpose of the movie
1:20 Salesforce Connector use to send REST API CMD
2:10 Run Demo with send Email from Salesforce
3:10 Documentation of Quick action
3:40 Extract QuickActions from your salesforce interface
5:35 Get default values for your SendEmail Quick action
8:20 Build your JSON to be able to send email
9:40 Run process for the test email
10:00 Configure Email to be from Salesforce Case
11:15 HTTP request approach for this use case
12:50 Conclusions
13:40 Subscribe to my channel

1 Like

Hi Cristian.
I’ve tried to send mail linked to Salesforce case and facing such error:

{
  "message": "Activity Lightning REST API Request ended with error:\r\n     Error Code: [FIELD_INTEGRITY_EXCEPTION] \r\n     Message: Related To ID: id value of incorrect type: 5008I000001m8gHQAQ",
  "level": "Error",
  "logType": "Default",
  "timeStamp": "14:55:14",
  "fileName": "Main",
  "processVersion": "1.0.0",
  "jobId": "74719c36-9cda-4433-8ad9-649b4575f098",
  "robotName": "oleh.stelmakh@finaro.com-attended",
  "machineId": 86421,
  "organizationUnitId": 883475
}

Could you please help me understand what could be the reason?

Hello Oleh,
To be fair I don’t know from the message. What I think is something related with
“contextId”: “YOUR ID”
be sure that this ID is between “” as string and is the corect ID of your case check this web page on the link when You navigate to Case.
Try with a new case created and link this email to this new Case.
Thanks,
Cristian

Hello Cristian,
Sorry for late response. I think I found the reason: In my company it seems that it is not possible to use Case as related to object.
Here is possible parameters for RelatedTo field:

            {
                "layoutItems": [
                    {
                        "editableForNew": true,
                        "editableForUpdate": false,
                        "label": "Related To",
                        "layoutComponents": [
                            {
                                "details": {
                                    "aggregatable": false,
                                    "aiPredictionField": false,
                                    "autoNumber": false,
                                    "byteLength": 18,
                                    "calculated": false,
                                    "calculatedFormula": null,
                                    "cascadeDelete": false,
                                    "caseSensitive": false,
                                    "compoundFieldName": null,
                                    "controllerName": null,
                                    "createable": true,
                                    "custom": false,
                                    "defaultValue": null,
                                    "defaultValueFormula": null,
                                    "defaultedOnCreate": false,
                                    "dependentPicklist": false,
                                    "deprecatedAndHidden": false,
                                    "digits": 0,
                                    "displayLocationInDecimal": false,
                                    "encrypted": false,
                                    "externalId": false,
                                    "extraTypeInfo": null,
                                    "filterable": false,
                                    "filteredLookupInfo": null,
                                    "formulaTreatNullNumberAsZero": false,
                                    "groupable": true,
                                    "highScaleNumber": false,
                                    "htmlFormatted": false,
                                    "idLookup": false,
                                    "inlineHelpText": null,
                                    "label": "Related To ID",
                                    "length": 18,
                                    "mask": null,
                                    "maskType": null,
                                    "name": "RelatedToId",
                                    "nameField": false,
                                    "namePointing": true,
                                    "nillable": true,
                                    "permissionable": false,
                                    "picklistValues": [],
                                    "polymorphicForeignKey": true,
                                    "precision": 0,
                                    "queryByDistance": false,
                                    "referenceTargetField": null,
                                    "referenceTo": [
                                        "API_Request__c",
                                        "Account",
                                        "Account_Scheme_Program__c",
                                        "Acquiring_Contract__c",
                                        "Amendment__c",
                                        "Archived_Email_Message__c",
                                        "Asset",
                                        "AssetRelationship",
                                        "Bank_Account__c",
                                        "CBK_Action__c",
                                        "Campaign",
                                        "Card_Scheme_Program__c",
                                        "Compliance_and_Fraud_check__c",
                                        "Contact_s_Distribution_Item__c",
                                        "Contract",
                                        "Contract_Amendment__c",
                                        "Corporate_KYC__c",
                                        "Descriptor__c",
                                        "Device_Management__c",
                                        "Fee_Details__c",
                                        "Fraud_Investigation__c",
                                        "Gateway_MID__c",
                                        "Gateway_Terminal__c",
                                        "IP_Detail__c",
                                        "Incident__c",
                                        "Life_Management_Action_Item__c",
                                        "Life_Management__c",
                                        "MCC2__c",
                                        "MID__c",
                                        "MOBA_tasks__c",
                                        "Merchant_MCC__c",
                                        "Merchant_Pricing__c",
                                        "Merchant_Pricing_and_Setup__c",
                                        "Merchant_Requirement__c",
                                        "Merchant_Setup__c",
                                        "Merchant_on_boarding_Action__c",
                                        "Monitoring_Details__c",
                                        "NEILON__Admin_Interface_Node_Configuration__c",
                                        "NEILON__Email_History_To_File__c",
                                        "NEILON__File_Access_Control__c",
                                        "NEILON__File_Download_History__c",
                                        "NEILON__File_Email_History__c",
                                        "NEILON__File_Version__c",
                                        "NEILON__File__c",
                                        "NEILON__Folder__c",
                                        "NEILON__Metrics__c",
                                        "NEILON__Tree_Configuration__c",
                                        "NEILON__Tree_Node_Configuration__c",
                                        "Operational_Setup__c",
                                        "Operations_Action__c",
                                        "Opportunity",
                                        "Opportunity_products__c",
                                        "Opportunity_scheme__c",
                                        "Partner_Contract_Amendment__c",
                                        "Partner_Fee__c",
                                        "Partner_Process__c",
                                        "Partner_Product__c",
                                        "Partner__c",
                                        "Person_KYC__c",
                                        "Product2",
                                        "Quote",
                                        "Risk_Assessment__c",
                                        "SFDC_Issue__c",
                                        "SFDC_Project_Team__c",
                                        "SFDC_Project__c",
                                        "Setup_Order__c",
                                        "Setup_and_Integration__c",
                                        "Solution",
                                        "Statement__c",
                                        "System_Access__c",
                                        "Terminal_Merchant_Requirement__c",
                                        "Terminal_Relationship__c",
                                        "Terminal__c",
                                        "URL__c",
                                        "Underwriting_Committee_Issue__c",
                                        "dsfs__CustomParameterMap__c",
                                        "dsfs__DocuSign_Recipient_Status__c",
                                        "dsfs__DocuSign_Status__c",
                                        "dsfs__EnvelopeConfiguration__c",
                                        "rh2__PS_Export_Rollups__c",
                                        "rh2__PS_Rollup_Dummy__c"
                                    ],
                                    "relationshipName": "RelatedTo",
                                    "relationshipOrder": null,
                                    "restrictedDelete": false,
                                    "restrictedPicklist": false,
                                    "scale": 0,
                                    "searchPrefilterable": false,
                                    "soapType": "tns:ID",
                                    "sortable": false,
                                    "type": "reference",
                                    "unique": false,
                                    "updateable": false,
                                    "writeRequiresMasterRead": false
                                },
                                "displayLines": 1,
                                "tabOrder": 7,
                                "type": "Field",
                                "value": "RelatedToId"
                            }
                        ],
                        "placeholder": false,
                        "required": false
                    },
                    {
                        "editableForNew": false,
                        "editableForUpdate": false,
                        "label": "",
                        "layoutComponents": [],
                        "placeholder": true,
                        "required": false
                    }
                ],
                "numItems": 2
            },