0 votes
in Rock by DavidTurner (14.9k points)
edited

Client (Woodman Valley) has PDF's being saved into a person attribute. They want to be able to mass export those files for a list of people right before an event happens.

2 Answers

+2 votes
by DavidTurner (14.9k points)
edited
 
Best answer

Pillars has already developed a GetFiles.ashx web handler similar to the core GetFile.ashx handler (notice the 's' on the end. The Pillars version will combine several binary files into one Zip file and then download that zip file.

The handler accepts following query string parameters:

  • ids - a comma-delimited list of binary file ids

  • guids - a comma-delimted list of binary file guids

  • EntitySetId - when this parameter is passed, the handler will also look to see if an AttributeId parameter was included. If AttributeId was not included, the handler will download any binary files who's ids are included in the EntitySet. If an AttributeId parameter is included, the handler will download the file associated with the attribute for any of the entities included in the EntitySet. For example, if the EntitySet includes a list of people, and the AttributeId is for a "Passport" attribute, the handler will download all the passport files for the list of people in the entity set.

  • AttributeId - Used in conjuction with the EntitySetId parameter (see above).

We've also created a workflow that can be configured to be run from a custom action on a Rock grid that will take the EntitySet of selected rows in the grid and then prompt user for what attribute associated with those entities they'd like to download. It then displays a link for them to click (with url to the GetFiles handler) that will then download all of the attribute value files for the selected entities. The workflow also has logic that if being used from a Group Member list, it will ask if person is wanting to download a group member attribute or a person attribute.

That workflow has been saved to the 9 Embers Snippet Library Workflows folder. (Download Multiple Attribute Files.json).

Here is a video of the workflow and file handler in use.

0 votes
by MarissaEubanks (4.0k points)
edited

We added a similar feature to allow for downloading files that are attributes on a registration instance for Fairhaven Church - in their example, these files are photos of families that register for a membership class.

HERE is the new workflow that has been saved to the Snippet Library. This workflow captures/sets the entity type (Registrant, Registration, or Person).

Example HTML to add the hyperlink in the registration instance page to the workflow linked above:


<div class='pull-right'>
    <a class='btn btn-sm btn-link' href='/WorkflowEntry/112?RegistrationInstanceId={{ Context.RegistrationInstance.Id }}'>Download Registration Files</a>
</div>
<div class='clearfix'>
    &nbsp;
</div>
Welcome! Here you can ask questions and receive answers (hopefully) from other members of our team.
...