Export attachments and filter on non-generic fields of the parent object (i.e. Salesforce Account)?

  • 74Views
  • Last Post 21 July 2021
  • Topic Is Solved
0
votes
Nic Stage posted this 14 July 2021

I am trying to export attachment files as a zip. I have succeeeded in getting files with an export package. But I want to get attachments specifically from the Salesforce Account object and filter by fields that are unique to the Account object. I can filter by the "parent object", but this doesn't give me access to Account fields. 

I thought maybe I could get a list of Account IDs that I want and then use that to match the generic ID field of the parent obejct in my attachments query, but it seems there is no way to do that.

Any help would be appreciated. Thanks!

Order By: Standard | Newest | Votes
1
votes
Olena Romanchuk posted this 15 July 2021

Hello, 

  The Attachment object may be related to different objects by ParentId. To get the attachments related to Account object only, we recommend you to use SQL command in your Export package.   To do this you should:

  1. Switch your package to new runtime first.
  2. Then in the package task editor you should select Advanced mode, and Execute Query Action.
  3. Open the Query Editor and try to build the query as in example:



      There you can modify filter the way you need.
    Please inform us if it works for you.

    Should you have any questions, please do not hesitate to contact us back.

    Olena,
    Customer Support Engineer

  • Supported by
  • Nic Stage
0
votes
Nic Stage posted this 15 July 2021

Thank you for your help! This gets me closer to what I need.

My problem now is that I am trying to filter down to over 100 accounts from many thousands. I need a way to upload a list of Account IDs to match, rather than manually entering them. Is that possible?

Or even if I could just paste in a list of IDs separate by comma. That would work too.

0
votes
Nic Stage posted this 16 July 2021

I'm starting the search for a different product that is capable of doing this. I'll follow this thread in case there are any updates.

1
votes
Olena Romanchuk posted this 19 July 2021

Hello, 

We are sorry for the delay with reply. 

In this case you can switch to Execute command Action and use the following query, where you can paste the needed range of account Id's:

SELECT t.*,a.Id as AccountId

FROM Attachment AS t inner join Account as a on t.ParentID = a.Id where a.Id in ('value1', 'value2','valueN')

Please revert to us if any assistance needed.

Olena,
Customer Support Engineer

 

 

 

  • Supported by
  • Nic Stage
0
votes
Nic Stage posted this 20 July 2021

Thanks for the reply. I spent yesterday trying this out. Unfortunately, the downloaded file is a zip archive of files with a .blob extension. Is there a way to convert those to the file types that they represent (PDF in this instance)?

1
votes
Olena Romanchuk posted this 21 July 2021

 Hello,

It is expected behavior for now.
In Export advanced mode (when the custom query is used) the attachments can be retrieved as BLOB files only.
However the simple mode allows to get the files of their actual type.
We will inform you if this setup is changed.

Please follow the news.

  • Supported by
  • Nic Stage
Close