Best answer

Using line items to send tweets

  • 16 April 2020
  • 1 reply
  • 1926 views

Hi, I’m extracting text from an email to send tweets. (Each tweet is about a new publication in a journal.) Problem is, each email might contain multiple matches to the pattern I’m looking for. So, I used “Text to Line-Item” to split the email into lines, and search each line for the pattern. So far, so good. E.g. I have an email that gets split into 5 lines, and of those 5 lines, 2 contain the pattern. All five lines are then output as line items. Like so:

0:

    _matched: false

1:

    0: title of first publication

    1: author of first publication

    2: DOI of first publication

2:

    0: title of second publication

    1: author of second publication

    2: DOI of second publication

3:

    _matched: false

4:

    _matched: false

 

This is where things get difficult. I want to build a tweet from each line item that matched the pattern.  But when I put in a step 4 to do this, I’m not offered the right inputs. What I get instead of items 0-4 is a dropdown showing me either “Output” (whose value is the whole array given above) or “Output 0” whose value is a string containing the 0 values for each of the five items, separated by commas!! I’m not offered an input *for one item*. So I can’t iterate through this list of items to do anything useful.

I’d be super grateful for any suggestions. (Adding a code step isn’t an option as I don’t know Python or Javascript.) Thanks!

 

icon

Best answer by nicksimard 18 April 2020, 00:16

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +11

Hi Mark,

Happy to see that you’ve reached out to our Support team and they’ve helped you out with this. It looks like you came up with your own solution in that thread. I’m going to post that here so others who find this topic can benefit:

 

I did just get the thing to work as I'd hoped. The problem was that I didn't realize that in the dropdown list of inputs, something like

Output 0: null,author 1 name,null,author 2 name

was the one to pick, because it iterates through the items. Anyway, thanks again.