Expand all | Collapse all

Pipelines Outlook email question

  • 1.  Pipelines Outlook email question

    Posted 10-22-2020 12:13

    I'm working on a pipeline to import emails from Outlook into a table in Quick Base and I'm having trouble capturing the recipient(s). I think the Outlook connector is returning a list or collection of recipients and Pipelines doesn't know how to stuff that into a Text or EmailAddress field. Pipelines gives me a fairly obscure error:

    Validation error: Incorrect template "{{a.to_recipients}}": issubclass() arg 1 must be a class

    If my conjecture is correct, the question is then how to transform that list of recipients into text or even just capture the first item in the list. I tried using a Jinja's for loop construct:

    {% for recipient in {{a.to_recipients}} %}
    {% recipient.email_address.name %}
    {% endfor %}

    But Pipelines will not accept that in the mapping field. That's as far as I've gotten. Any help would be appreciated.

    Rick Putnam

  • 2.  RE: Pipelines Outlook email question

    Posted 10-22-2020 12:27
    I have a partial solution which is to write:


    That captures the first recipient -- and for my current use case, that's enough. However, I'd still be happy to hear solutions for capturing all the recipients.


    Rick Putnam

  • 3.  RE: Pipelines Outlook email question

    Posted 20 days ago
    Edited by Angel R 20 days ago
    Hi Rick,

    I had the same issue, but I found that I could use a for loop using jinja templating to pass all of the recipients into one field. 

    Try this for loop:
    {% for email in a.to_recipients %}
    {% endfor %}

    The {% code here %} is similar to how you would add JavaScript in Node.js, Python inside of Django html templates, Ruby inside of Ruby on Rails html templates, etc. The double curly braces represent the {{ variable }} data you would like to pass into these templates. In our case, the object data in Outlook into our template. 

    Here, email is your loop variable. This allows you to iterate through your a.to_recipients array (or list in Python). 

    so you can prefix email_address.name with the email variable using dot notation and this gives you the value index[email] inside of your for loop. This is the same as the value of email from a.to_recipients[0], a.to_recipients[1], a.to_recipients[2], etc. in sequence until you reach the end of the array. Hope this helps!

    I'm also adding a snapshot of what I put together in Pipelines to put this into context.