Flow to find records that have an Attachment

Options

As part of a data audit, I'm trying to locate all records that have an Attachment.

We use PaperSave, so we need to find records where a user may have mistakenly uploaded their document to the Attachments panel instead of PaperSave. This isn't possible using Query or Lists.

Using logic similar to that which is found in the Missing Prospect Status Digest Email (which Alex did a great demo on for BB Dev Days), I'm trying to figure out how to identify the records that have an Attachment.

The challenge I face is with the Condition to get the right Outputs which will identify the records. I was thinking that if there was a File Size ≥ 1 that might indicate that something exists.

ef3bc94b0519717496606d11a6e4e056-huge-fi

I get this error when I run it, and am unsure how to change try to change the data type:

1e8bc417f429144884a1d3de0d7ca070-huge-ou

Thanks.

Comments

  • Hey @Chris Zello, use the Value field from the List Constituent Attachments action and wrap the left side of the condition in a length() expression. This will evaluate the field to 0 if the call returns an empty array.

  • @Matt Thacker I need additional information explaining how to wrap Value inside of length().

    Did you mean to go into the Condition Expression and type length(outputs("List_constituent_attachments")?['Value'])

    Or something else?

    Thanks.

  • @Chris Zello
    I think you'd need to use: length(outputs('List_constituent_attachments')?['body/value'])

    However, I believe the List Constituent Attachments action also returns “Count” in the dynamic content, so you could just use that in your condition instead if you wanted to. If Count > 0 or whatever you need for your workflow.

  • @Ben Regier Thanks for the idea Ben. I used the Count condition, and it seemed to work. When trying it on a larger list, some without an Attachment on the record, it didn't work accurately. It seems to give me everyone. So I need to try to expression approach.

    UPDATE: It works when using the expression. Thank you!

Categories