Question

Identifying the correct Salesforce Attachment for Opportunity Object to Upload to CompanyCam

  • 31 January 2024
  • 19 replies
  • 81 views

Hi there,

 

I am looking to set up a Zap that is triggered when an Opportunity in Salesforce is moved to Closed Won stage. At that time, I want to identify the related Attachment with name like ‘%FINAL%’ and upload to CompanyCam as a photo. I’ve gotten steps 1 (trigger when stage is updated to closed won) and 3 (sending attachment to CompanyCam) worked out, but for step 2 (finding the record by query in Salesforce), I am having trouble with my WHERE clause. I am using Attachment Salesforce object, looking for Name LIKE ‘%FINAL%’ AND ParentId = ObjectId but it is giving me an error. Any help would be appreciated!


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

19 replies

Userlevel 7
Badge +14

Hi @RooferA 

For us to have full context, please post screenshots with how your Zap steps are outlined and configured.

I’ve attached a Word doc with all of my steps and screenshots. Thank you for your help @Troy Tessalone 

Userlevel 7
Badge +14

@RooferA 

Help article from the field description to reference: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_conditionexpression.htm

 

In Step 2, for the WHERE Clause, try putting ‘ and ‘ around the mapped variable. (similar to how you have it for ‘%FINAL%’)

 

In Step 3, for the Image URL, you would need to map the file url or file object from Step 2.

Help article about using files in Zaps: https://zapier.com/help/create/basics/send-files-in-zaps

 

@Troy Tessalone thank you - that is very helpful. I do still have one issue. This is the Records Atrributes URL returned in step 2: /services/data/v55.0/sobjects/Attachment/00PQK000002kJRW2A2. It is not being recognized as a valid URL. Is there a prefix I am supposed to find from elsewhere?

Userlevel 7
Badge +14

@RooferA 

Looks like the ID of the attachment is at the end of the path: 00PQK000002kJRW2A2

Try using that in a new Find Record step.

@Troy Tessalone Perfect - I used the Zapier File URL for the photo that I got in the output of the new Find Record step in my final step and it worked. While everything shows a success, when I check the record in CompanyCam, the photo is not there.

 

 

Userlevel 7
Badge +14

@RooferA 

Help article about sending files in Zaps: https://help.zapier.com/hc/en-us/articles/8496288813453

Make sure the attachment link from Salesforce is a publicly accessible direct download link.

Make sure to refresh CompanyCam before viewing the results.

 

You should be able to use the returned ID from CompanyCam to find the Photo in CompanyCam.

 

@Troy Tessalone I looked up the ID in company cam - no luck. I then followed the Company Cam URL from the output and I get invalid source image

 

Userlevel 7
Badge +14

@RooferA 

Can you provide the link to the attachment from Salesforce as an example?

@Troy Tessalone 

https://img.companycam.com/eroDiWPayGT3vCcwPexPsEwVZJUgeba_mLtwYKp0f4E/rs:fit:4032:4032/q:80/aHR0cHM6Ly96YXBp/ZXItZGV2LWZpbGVz/LnMzLmFtYXpvbmF3/cy5jb20vY2xpLXBs/YXRmb3JtLzE5NzUz/L2tlXzlkZnFmVEZk/djI2bVo0U2QxN0ds/TEgyOS0zM0gydWNo/TEpzVlQzeVhvSHZE/dUdJQlVjQTVEeGpm/emtvTFFic1lVZWNu/TlF1QlVRc0lWVzVj/dlhLZTd2SVRDcl92/N08yY2p2aUxlUVV2/elVDYnpNYnFDV2th/V2Z3ZDZmNzN6ME9C/MjJRcVBheTVzRzYw/YUV4N2dEazcxVDVR/bVNBVVF4a3pkZlFB/Slp2SQ.jpg

Userlevel 7
Badge +14

@RooferA 

The provided link is from CompanyCam.

We need to see the link of the attachment that was sent to CompanyCam from Salesforce.

@Troy Tessalone I can’t provide the actual link as it contains confidential customer info but I am using the File link from Zapier. When I follow the Zapier link, the file does open, just as an FYI

 

Userlevel 7
Badge +14

@RooferA 

One way to check if the link returned from Salesforce is usable, it to copy/paste it into a new/different private browser to see if it initiates a direct download.

 

Can you show how your CompanyCam Zap step is configured?

 

@Troy Tessalone - I used the File field from step 3 as the Image URL

 

Userlevel 7
Badge +14

@RooferA 

You can try these options for help:

 

The mapped variable is a file object rather than a file url, which may be contributing to the issue. (it shouldn’t but it might)

 

CompanyCam API endpoint docs for Add Photo: https://docs.companycam.com/reference/createprojectphoto

 

Userlevel 7
Badge +14

@RooferA 

I tested with both a file link and a file url, both worked to upload images to CompanyCam.

Userlevel 7
Badge +14

@RooferA 

Did you check this?

One way to check if the link returned from Salesforce is usable, it to copy/paste it into a new/different private browser to see if it initiates a direct download.

@Troy Tessalone yes. I pasted the File URL from step 3 into a new window and it downloaded the image. I just don’t know why it step 4 it says “Exists but not shown”

Userlevel 7
Badge +14

@RooferA 

This is a file object which is a temp file (that expires) of the file from Salesforce.

Perhaps try retesting the Zap steps 3-4.

Otherwise, I recommend reaching out to Zapier Support: https://zapier.com/app/get-help