Reverse lookup function

Applies to JungleDocs for SharePoint 2010-2019.
For JungleDocs for Office 365 tutorials, click here.

JungleDocs reverse lookup function allows you to easily export items from SharePoint into a specific list given they have a common lookup value. For example, if you have a  Contacts list, and the list has a lookup column linking to Company Name column in the Companies list, you can easily generate a report of that company contacts by running JungleDocs from the Companies list. In order to be able to that, you must configure the corresponding JungleDocs template, JungleDocs rule, and content type.

In this tutorial, you will learn how to use this function.

A mandatory requirement for the reverse lookup to work is a lookup column in your content type that you use to generate the reverse lookup report. 

in the case of the example above, you need to add the lookup column linking to the  Companies list.

  1. Go to content type settings and click Add from new site column:

  2. In the new window, enter column name (e.g., Company) and select Lookup as column type:

  3. Select the lookup list and column name. In our case it is Companies list and Company Name column:

  4. Select if you want to include any other columns from Companies list and click OK. Once you have the lookup column, you can edit the JungleDocs rule and template.
  5. Go to the Companies list, run JungleDocs and click New From Existing rule:

  6. In the new window select target library and Base rule:

  7. Choose document template:

  8. Set miscellaneous settings like rule name and visibility.
  9. Also map the target content type - Company column - to the source list (Company Name column), because the Contacts list also has a lookup column linking to the Company Name column:

  10. Click OK to save the settings.

Now that we have configured the content type and the JungleDocs rule, we only need to configure the template.

Note: In order to generate a report, we need to create a repeated section in the document template. The repeated section overlaying content control will use a  ReverseLookup () function. It has to be specified in the following format: LookupColumn :ReverseLookup ("List Containing the items"). The column we previously added to the content type must be the same column that your soon-to-be-exported items have. In our case it is CompanyList Containing the items is the list where your soon-to-be-exported items are stored. In our  case  it is the Contacts list. The final formula for the content control looks like this: Company :ReverseLookup ("Contacts")

  1. To create the repeated section in the template, start editing the template. Run JungleDocs, start editing the rule we previously created, start editing the base rule and click "Edit template":

  2. Once you open the template, create a table, select a row and add a rich text content control:

  3. Open control properties:

  4. Enter Company:ReverseLookup("Contacts") in the Tag field:

  5. Format the table according to your requirements, add other content controls for other fields from the Contacts list, and your repeated section is ready:

    Now you can select a company, run JungleDocs rule that you previously created, and you will get a list of contacts for that company.

Note: if you are trying to resolve items from a list that is on a different site, you can use Site/list in the reverse lookup command. So the command from this example would look like this: Company :ReverseLookup ("Sales/Contacts") if you are running JungleDocs from a site different than Sales.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us