Public Key is Invalid!

30 views
Skip to first unread message

Alfonso

unread,
Sep 20, 2016, 3:13:38 PM9/20/16
to floreysoft
I am using the following script:
// The following method will be invoked whenever Ultradox executes the script
function execute(mode1) {


 
var sheet = SpreadsheetApp.openById('1U8rRo87vzEG3yDYD6-TAB-3n9-Rlunza1TgYnBUyRyc').getSheetByName('Pagare-Entries');
//Change the sheet Id and name as appropriate
   
var lastRow = sheet.getLastRow();


   
var response = UrlFetchApp.fetch('http://www.ultradox.com/run/6VbYGN7gDDOf4MvFcAT2808ricy8bW&chunk='+lastRow);}



to trigger ultradox to run when a new row is added to Google sheets. I got this idea from this post.
I followed the instructions to the very last detail. 

When I run this I get the following error:
The script Pagare-Trigger-Script-1 failed with error: Exception: Request failed for http://www.ultradox.com/run/6VbYGN7gDDOf4MvFcAT2808ricy8bW&chunk=28 returned code 404. Truncated server response: <html><head> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <title>404 Public key is invalid! The public key of the Ultradoc ma... (use muteHttpExceptions option to examine full response)

I tried generating a new public key for the Ultradox I want to run...but to no avail.

Has anything changed in Ultradox that makes this command unusable?

The Ultradox that is being triggered is a simple Google Sheet to PDF...

The good news: the script does locate the google sheet and it does find the last row. But when it gets to the point of running the script, it crashes. 
Screen Shot 2016-09-20 at 3.12.00 PM.png
Screen Shot 2016-09-20 at 3.12.29 PM.png

Daniel Florey

unread,
Sep 20, 2016, 3:19:57 PM9/20/16
to floreysoft GmbH
Can you please try to replace the & before the chunk with a ?

--
You received this message because you are subscribed to the Google Groups "floreysoft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to floreysoft+unsubscribe@googlegroups.com.
To post to this group, send email to flore...@googlegroups.com.
Visit this group at https://groups.google.com/group/floreysoft.
For more options, visit https://groups.google.com/d/optout.

Alfonso

unread,
Sep 20, 2016, 3:32:46 PM9/20/16
to floreysoft
Great. The Public Key Invalid! error went away, but I got this other error now:

The script Pagare-Trigger-Script-1 failed with error: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1

Daniel Florey

unread,
Sep 20, 2016, 3:38:42 PM9/20/16
to floreysoft GmbH
You do not need to add the script to your flow. Just let it call the flow and then do whatever you want in the flow (like loading the row from the spreadsheet)...

--

Alfonso

unread,
Sep 20, 2016, 3:53:27 PM9/20/16
to floreysoft
ok, I am not sure how to do that. Please see attached screenshot on how the trigger is configured right now. I have a task to Run Script. 

If i don't add it to flow, where then does it run? How do I call it?

Sorry, I'm new to your program and I'm learning it. 
To unsubscribe from this group and stop receiving emails from it, send an email to floreysoft+...@googlegroups.com.

Daniel Florey

unread,
Sep 20, 2016, 3:55:05 PM9/20/16
to floreysoft GmbH
Hi,
Thanks for the your request!
Can you please post your questions to the Ultradox community?
https://plus.google.com/u/0/communities/114712965181154407381

You can then get help from other users - and if we answer, others will benefit from the knowledge.

Thanks,
Daniel


To unsubscribe from this group and stop receiving emails from it, send an email to floreysoft+unsubscribe@googlegroups.com.

Alfonso

unread,
Sep 20, 2016, 3:58:50 PM9/20/16
to floreysoft
ok, I am not sure how to do that. Please see attached screenshot on how the trigger is configured right now. I have a task to Run Script. 

If i don't add it to flow, where then does it run? How do I call it?

Sorry, I'm new to your program and I'm learning it. 

On Tuesday, September 20, 2016 at 3:13:38 PM UTC-4, Alfonso wrote:
Screen Shot 2016-09-20 at 3.51.57 PM.png

Alfonso

unread,
Sep 20, 2016, 4:25:15 PM9/20/16
to floreysoft
The problem is that the integration goes as follows:

1. Submit entry from Gravity Form
2. The Gravity Form Entry has to post to a Google Sheet. That process takes at least 1 minute, therefore the script cannot run automatically.
3. That is why I have a Timer Block set to 1 minute, to give the data from the Gravity Form time to post to the google sheet before running the script to generate the document. 

So if I trigger the web app directly from the Gravity Form, then I risk not generating a document with the correct record. 

I was following the instructions from this post
From the New Ultradox > Name it 'Trigger' > Set a 1 minute Timer as the first block (otherwise the trigger will start before JotForm has a chance to write the new form data to your Sheet) > Insert a Google Apps Script - My Script Block >

So when you tell me I don't need to setup a Timer Block or a Script block, I am really at a loss. 

The good news is that the script now runs and I get an email with the generated document.

The bad news is that the script is not selecting the last row as indicated in the script:
// The following method will be invoked whenever Ultradox executes the script
function execute(mode1) {


 
var sheet = SpreadsheetApp.openById('1U8rRo87vzEG3yDYD6-TAB-3n9-Rlunza1TgYnBUyRyc').getSheetByName('Pagare-Entries');
//Change the sheet Id and name as appropriate
   
var lastRow = sheet.getLastRow();



   
var response = UrlFetchApp.fetch('http://www.ultradox.com/run/6VbYGN7gDDOf4MvFcAT2808ricy8bW?chunk='+lastRow);}


The error I get is 

16:12:24
The script Pagare-Trigger-Script-1 failed with error: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1

On Tuesday, September 20, 2016 at 3:13:38 PM UTC-4, Alfonso wrote:
Reply all
Reply to author
Forward
0 new messages