Archive for the ‘Mail and Document merge’ Category

Using Logic and Conditionals When Generating Documents

Sunday, July 30th, 2017

Sending a well crafted thank you letter to your donors is an essential part of your non-profit’s fundraising efforts. Acknowledging a donor in a timely manner increases giving and also improves donor retention. And when you need to send large numbers of such letters, you would want to automate the process so that members of your staff can send them off with a couple of clicks. This is when you need Apsona’s Document Generator to set up the process seamlessly.

A use case – Consider a scenario where you need to send your donors a thank you letter after a successful campaign. In this case, the content or the body of the letter is the same for all donors, but the signatures on the letters are determined by the donation amount. Donors who have donated $500 or more get a thank-you letter signed by the President of the organization. Those who have donated between $250 and $500 get letters signed by the Executive Director, and donors who have given under $250 get a letter signed by the Philanthropy Officer.

Setup – Setting up the merge with Apsona’s Document generator is a four-step process: Create a template, creating the data sources for the template, map your data, and generate documents. As the body of the letter is the same for all the donors, the template will only need to have the required merge fields or place-holders for the relevant data to be filled in. With Apsona’s support for conditional directives (i.e., if-then-else), you can selectively include or exclude content in your document based on data conditions. In the use case we are looking at, it is the different signatures on the letters determined by the donation amount.

template1

In the above template, we have just four merge fields as place-holders: First name (Donor name), Donation amount, date the payment was received and the Household name. The data for the merge fields are available in the Contact object, and the data for the merge fields in the body are available in the Opportunity object, and the two are linked via the Primary Contact lookup in the Opportunity object. So you can create a simple Opportunity report that extracts all the necessary data fields to generate this document.

The signature area contains conditional directives to drive the logic outlined above:

«IF Opportunity_Amount>=500»John Doe
President«ELSE IF Opportunity_Amount>=250»Jane Doe
Executive Director«ELSE IF Opportunity_Amount>=100»Jill Doe
Philanthropic Officer
«ELSE»John Doe
President «ENDIF»

In the above example, we use four directives, IF, ELSE IF, ELSE and ENDIF, to provide the logic. Each directive is created as a standard Word merge field. The code in the above example looks for the template field Opportunity_Amount. The text of the signature is interspersed with the directives so that the required logic is implemented.

It is important to ensure that each IF directive must be followed at some later point by a corresponding ENDIF directive so that the text segments that produce the signatures are clearly differentiated from the main body of the document. The document generator checks for this condition, and if a violation is detected, it might produce an error message like the one below.

IF

The example here shows the If – Then – Else conditionals in the signature are of the letter but you can get really creative and use it from the address and body of the letter as well. Detailed documentation on the If -then- Else conditionals is available on the Apsona website. Here is the link.

Happy New Year from the Apsona Team

Wednesday, December 31st, 2014

As 2014 draws to a close, we thought you’d be happy to hear from the two Apsona elves that are hard at work creating new features to serve you better. So here are some features you might like.

  • The field selector for creating filters and for adding fields to reports is now easier to use as well as searchable for both objects and fields. You might look at the screen shots in our documentation, and better yet, try it out!
  • Administrators can now manage their Document and Mail merge licenses from within the Apsona application.
  • Document and Excel merge actions can now be invoked directly from either a detail page button or a Salesforce sidebar component, e.g., from the left side of your Salesforce home page. Visit our website for more information about this.
  • You can now generate address labels from the document merge tool.
  • As always, if you see bugs or glitches, or have questions or suggestions, please do not hesitate to contact us.

    Thank you for supporting the Apsona apps. Wish you the very best for 2015 and beyond.

    The Apsona team
    http://apsona.com/salesforcehttp://apsona.com/blog/happy-new-year-from-the-apsona-team/http://apsona.com/blog/happy-new-year-from-the-apsona-team/http://apsona.com/blog/happy-new-year-from-the-apsona-team/http://apsona.com/blog/happy-new-year-from-the-apsona-team/http://apsona.com/blog/happy-new-year-from-the-apsona-team/

    How To Generate Documents and Emails with Apsona

    Tuesday, April 29th, 2014

    Apsona’s new merge tool allows you to quickly generate Word, Excel and email directly from your Salesforce org. You can generate end-of-year tax summaries and thank-you letters to your donors, or a proposal or quote to your customer, as a Word document. You can choose to send donors an email via a HTML template if you want to go paperless. And you can also render your pledged and posted donations into a multi-sheet Excel report, complete with charts and pivot tables. All of this functionality is included in one package – Apsona Document and Mail Merge.

    Here are some of the key benefits of the Apsona merge add-on.

    • Entirely browser-based:  The merge process works entirely within your browser, and has no interaction with any external services. So your data never leaves your browser. This is unlike many competing products, which typically ferry your data over to the vendor’s server and carry out the merge process there.
    • Flexible field naming in templates: Template building is quick and easy: you don’t need to adhere to any particular naming convention of Salesforce field names. When you create the template, you simply make up any field names you want, and Apsona will discover those names and let you match them with data fields.
    • Compatible with existing templates: If you have already created document templates for competing products, Apsona’s merge tool can usually use them directly with no change.
    • Powerful data retrieval ability: You can leverage Apsona’s powerful reporting capabilities as the data source for the merges. Data can be retrieved directly from a Salesforce object, or from any Apsona report – single step or multi-step. Thus you can combine fields from multiple objects into one template. You can even include calculated (aggregate) fields such as total donation amount in the last six months, or the most recent gift date last year – calculations that might not be available through roll-up fields. Filters can be added to an existing merge on the fly.
    • Integrated with Salesforce buttons: The merge add-on integrates into Salesforce detail pages via custom buttons. Setting up a button is simple: Generate the code for the button from within Apsona and paste the code into the button’s JavaScript area. No need to mess with template IDs, query IDs or URLs, unlike competing products.

    Example: Sending a thank-you letter. A thank-you letter typically includes merge fields from the Contact object, such as the name and address. It might also include merge fields for sub-lists, e.g., a list of donations by that contact, containing the date, amount and campaign of each donation. To create such a merge:

    • To include a list of donations by the contact, you can build a table in the document template. The rows of the table might contain Donation merge fields, such as amount, payment method and donation date. As with other similar products, the leftmost cell in the table should include the TableStart field, which specifies a record group name following a colon. The rightmost cell in the table should similarly include the TableEnd field. These two markers indicate the region of the document that must be replicated, once for each Donation.
    • The data source for a template can be obtained from pre-built Apsona reports, or directly from an object. For example, the Contact information can come from the Contact object, and the list of donations can be obtained from a Donation report. Before running a pre-built merge template, you can also apply additional filter terms that are not specified in the Donation report.

    You can also generate customized emails using email templates stored in your Salesforce Communication Templates. As with documents, the tool can recognize merge fields in the email template and generate customized emails from the corresponding data. It can even attach a generated Word document with a generated email before sending it off. It can also handle email templates made with letterheads.

    A system administrator can set up merge actions using templates and their data sources, and all that the end user has to do is run an existing merge action whenever the need arises. The administrator can also manage merge actions, e.g., identify unused ones and delete them.

    You can try out the Document merge, Excel merge, Email merge and Email and Document merge when you download the Apsona for Salesforce app from the AppExchange. For more details, please visit our website or email us at support@apsona.com.

    We would like to thank Idealist Consulting for hosting this blog entry.

    Thank-you Letters with Apsona’s Document Merge

    Friday, August 30th, 2013

    Thank-you appreciation letters by snail mail are the lifeblood of  nonprofit organizations. The donor needs to be convinced that he/she has made a  right investment and the donation will be used wisely. Appreciation letters need to be sent not only after every donation, but also once or twice a year. Personalizing the letters is key to a positive experience, but when this has to be repeated to hundreds of users, it is a major challenge to small/medium non profit organizations. The cost and effort of producing such personalized letters several times a year can be rather daunting.

    Apsona’s Document Merge add-on for Apsona for Salesforce is exactly what is needed in these cases.  Users can build flexible templates that can contain multiple fields drawn from multiple objects – Contact, Donations and so on. Aggregate fields and sub lists can also be included in the template.  Fields names in the template and in the tables can be adhoc and need not be exact matches to the field names in Salesforce or in the reports. What Apsona brings is the utter simplicity and flexibility of the entire process for the template builder. Apsona’s  DocMerge will produce  a single or batch of .docx document files from a .docx template and the results can be downloaded either as a.zip file  or as a single .docx file with many pages, one for each record and print them.

    Here is the simple step by step process.

    1. A thank you letter will typically have top level merge fields from the Contacts object like the name and address. When creating this letter template in Microsoft Word, create merge fields with the usual Quick parts – Field – merge field. You can also Apsona’s macro to build quick merge fields, and that is definitely a time saver and less tedious (our humble opinion).
    2. Next, if you need to include a list of donations to the contact, you build tables. Tables are very easily created. The leftmost cell in the table should include the TableStart field, which specifies a record group name following a colon. For example, for the tag TableStart:Donation, the suffix Donation will be the name of the record group for the table. This name is just a mnemonic indicating the kind of list being produced. You can make up any name you want, as long as it does not conflict with any other merge field name in the document. The rightmost cell in the table should similarly include the TableEnd field. These two markers indicate the region of the document that must be replicated, once for each Donation.

    3. The data source for a template can be obtained from pre-built Apsona reports, or directly from an object. For example, in a single template data for a list of donations can be obtained from a Donation report and data for a list of  in-kind donations can be got directly from the Assets object. Before running a pre-built merge template, you can also apply additional filter terms on the fly if required.

    That’s it — system administrators can set up templates and its data sources, and all that the end user has to do is run an existing merge action whenever the need arises.

    Apsona’s merge tool also supports Excel merge and email merge. For a more details on these features please visit our product description page.

    How to quickly create merge fields in Word

    Wednesday, May 29th, 2013

    As part of the development of our document merge tool, we work quite a bit with Microsoft Word templates. And naturally, our testing process requires us to create lots and lots of merge fields in Word. Now if you have worked with merge fields, you know that creating a merge field can be a bit tedious: You have to click Insert – Quick Parts – Field, scroll down in the Field names panel, click MergeField, and then type in the name of the field into the Field name box. And you have to do this for every field you need. That’s a lot of clicks, particularly when you want to create a good many merge fields.

    Being the lazy folks we are, we wanted to speed up this process. So we created a little WordBasic macro to help us along. With this macro in place, when we want to create a new merge field, all we need to do is

    1. type in the name of the field into the Word document, just the same way we type any other text;
    2. select the field name text; and
    3. click a button.

    Voila. The text is instantly converted into a merge field.

    Below is the text of the macro.

    Sub MakeMergeField()
    Selection.Copy
    Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
    "MERGEFIELD """ + Selection.Text + """ ", PreserveFormatting:=True
    End Sub

    And here are the steps for setting up a button for this macro in Word. Keep in mind that even though this list of steps seems a bit long, it’s actually quite straightfoward. This is a one-time setup, and you will have the button available anytime you want.

    1. Make the Developer tab available in your Word ribbon. See directions for doing this in Word 2007 and Word 2010.
    2. Click Developer – Macros. In the resulting popup, type MakeMergeField in the Macro name box, and click the Create button. The Visual Basic editor appears, with the macro outline already set up, and the cursor placed in the macro body.
    3. Copy the three lines in the body of the macro text above (between the Sub and End Sub lines) and paste them into the body of the macro.
    4. Close the Visual Basic editor.
    5. Create a new button for this macro in your quick-access toolbar.

    Below is a short video demonstrating the steps. Enjoy! We hope you find this useful.

    Document and Mail merge for Salesforce

    Thursday, April 25th, 2013

    Apsona is happy to announce a new add-on Mail and Document merge. Version 1.0 of the merging tool caters to three common situations:

    • Email merge: Produce a batch of email messages from an email template, and send off the email messages.
    • Document merge: Produce a batch of .docx document files from a .docx template, and download the results as a .zip file.
    • Email and document merge: Use a specified email template and a specified document template to produce a batch of email messages and documents, attach each resulting document to the corresponding email, and send off the emails.

    In all of these cases, the data to be merged into the template can be obtained either from an Apsona report, including cross-object reports, or from the records in any of the Salesforce objects via Apsona’s console or tabular views.
    For email templates, the merging tool can use any of the templates stored in your salesforce org, i.e., the ones accessible via Setup – Communication Templates – Email Templates. For document templates, the merging tool can use any .docx files available in your Salesforce Documents object.
    Below is a brief comparison of Apsona’s Merge/mail with other competing products:

    • You don’t need special names for merge fields. This is unlike many other products. When creating a template, you can make up any field names you want, and the merge tool discovers and matches those names with your data fields on-the-fly.
    • You can mix-and-match templates used with reports. Since merge field names are not linked to (i.e., don’t have to be the same as) either data field names or report field names, you can use the same report with multiple templates. For example, you can create an Apsona report of your top opportunities from last month, filter it once for the gold partners and send using the “gold” template, and then filter it for the “bronze” partners to send using the bronze template. The two templates to not have to use the same field names.
    • It can use any of your existing document and email templates — no need to rewrite any of them.
    • It works with cross-object reports. So you can (for example) create a report including contact fields and total value of opportunities/donations, and send the results via email.

    In the coming versions Apsona’s Mail and Document merge will support merging of lists, PDF and Excel options. If you would like to try out this feature, please click the Feedback link in the Apsona app and send us a License request.