2
votes

The situation is as follows: there is a gmail contextual gadget, which requires access to two fields simultaneously: MessageID and sender’s email. Standard extractors seem not to support multiple fields, so I use a custom extractor. The problem is, it just doesn’t work.

It seems I do something wrong during extractor upload and registration. So far as I get it, one must (1) upload an extractor using Google Apps Extensions Console (as described here: https://developers.google.com/google-apps/extensions-console/?csw=1#extractor), and then (2) one specifies its url, parameter name, and parameter value in Google Apps Marketplace SDK when configuring gmail contextual gadget (mentioned here https://developers.google.com/apps-marketplace/preparing).

Depending on what I enter on the step (2), the result is either that the contextual gadget never appears at all, or that the contextual gadget is triggered but only one field value is available (namely, the one I specified in ‘parameter name’/’parameter value’)

What am I doing wrong? It seems strange that I specify one parameter name/value in Google Apps Marketplace SDK when there are in fact several parameters. Is there another way to register a custom extractor? Or are custom extractors obsolete, being substituted by something newer?

2
Why tagged apps script? It isn'tZig Mandel
The parameter name and value correspond to the Param tag listed here: developers.google.com/gmail/… These should only be used to filter the matched emails. Are you also finding that it's limiting which extracted values get sent to the gadget?Eric Koleda
I need sender's email to filter the matched emails, and both messageID and sender’s email in the gadget. It is possible to manage with only messageID in the gadget, getting sender's email via gmail API. But for filtering the sender's email is crucial.Alexey Vashchenko

2 Answers

1
votes

With google contextual gadgets you may use multiple fields. I got it working a few days ago:

  • After you've enabled the Universal Extensions and COB extensions accordings to this document
  • Add each extractor you want separately.
    • For each extractor:
    • On the extractor url it's the google.com:xxxxxExtractor url
    • For the gadget URL use your gadgets URL
    • I got it working by leaving the Extractor param name empty as well as the Extractor param value, because my use case has no need for them at the moment

UPDATE
Afterwards I had to use the Extractor param name and Extractor param value, they have the small caveat that if you specify them for ONE extractor you have to specify them for ALL of them. As well as using the Output Fields as the Param Name indicated in the table here. I only used a single param name for each extractor.

In your gadget.xml

Add a comma separated entry for each extractor url you're adding in the developers console.

<Require feature="google.contentmatch">
        <Param name="extractors">google.com:XXXXExtractor,google.com:YYYYExtractor</Param>
</Require>

Remember to make sure you're using the same Gadget Url for every extractor entry and to append nogadgetcache=1 in the Gmail window in order to debug the behavior.

Remember to also enable access to the newly extracted field in your domain's console in the Data Access area of the app. New fields will require new permissions and they won't work unless specifically allowed.

0
votes

I never got a custom extractor to work that would output more than one value to gadget for old marketplace. Secondly, I never got a custom extractor to work at all for new marketplace.

You could try to parse the message ID from window URL and still filter on the sender's email. but I honestly never tried this approach.