The macro is intended to upload any file on the SalesForce platform. To use the macro, we first need to create an application in SalesForce, so check with the platform administrator for this feature. After the creation, two codes will be available, the ClientSecret and the ClientId.
For integration to work, you must send the following fields to the macro:
Columns | Values | Obs. |
URLBase: | https://my.salesforce.com | URL SalesForce |
auth: | /services/oauth2/token | String de autentication |
grant_type: | password | Type acess |
client_id: | exemplo | Key generated by application created in SalesForce |
client_secret: | exemplo | Key generated by application created in SalesForce |
username: | teste | access user |
password: | teste | password user |
OwnerId: | 12n313in4 | Creator ID of the record you want to link |
VersionData: | n2ne2nin42i4no2n41i24i24non44i4o124n14n | File converted to base64 |
Title: | Teste | Title file |
PathOnClient: | Teste.pdf | Type File |
ContentLocation: | S | Document is located within Salesforce. Label is Salesforce. |
Id: | 2ni4ni3on3io | ID of the record want to link |
After filling in the fields and sending it to the macro, in the backend the macro must create a record in the ContentVersion object and then in the ContentDocument object. After the records are created in the objects mentioned above, the workflow will create the file link to the source record creating a new record in the ContentLink object and must end the process by returning the JSON of response if the record was created or not.
Below are images of the macro with the examples mentioned above:
Input Macro
Create connection the SalesForce
Create record the object ContentVersion
Captures the new record created in the ContentVersion object and links it with the source record in the ContentLink object
If you need help, I'm available.
Read More