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.

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": [
                                    "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