Ultradox trigger new row added (not by form)

416 views
Skip to first unread message

Zbulo! Discover Albania

unread,
May 25, 2015, 4:22:45 AM5/25/15
to flore...@googlegroups.com
It seems only Google Form submission (that creates a new row) triggers the Ultradox workflow.
Is it possible to trigger it with each new row, no matter the source? I have several other apps that feed into the sheet. 
If no "easy way" I will try to employ a Google Script that will call the first buildings blocks url, that should work, no?

Daniel Florey

unread,
May 25, 2015, 5:47:41 AM5/25/15
to floreysoft GmbH
You'll need a Google Script for that. Just call the integration URL (link icon on the main toolbar) from Apps Script and pass the row number as chunk parameter.
See:

--
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+...@googlegroups.com.
To post to this group, send email to flore...@googlegroups.com.
Visit this group at http://groups.google.com/group/floreysoft.
For more options, visit https://groups.google.com/d/optout.

Zbulo! Discover Albania

unread,
May 26, 2015, 3:57:02 AM5/26/15
to flore...@googlegroups.com
I tried the following but the lastRow is not inserted.
I seem clueless about Googe Apps and don't know how to insert the variable value.

function myFunction() {

var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var lastRow = sheet.getLastRow();

}

Daniel Florey

unread,
May 26, 2015, 4:01:44 AM5/26/15
to floreysoft GmbH
You'll have to do something like


instead (appends lastRow as value)

Zbulo! Discover Albania

unread,
May 26, 2015, 4:05:04 AM5/26/15
to flore...@googlegroups.com
I feel like a monkey sometimes, thanks. :) 

--
You received this message because you are subscribed to a topic in the Google Groups "floreysoft" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/floreysoft/Psz0N1O7Bz4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to floreysoft+...@googlegroups.com.

Zbulo! Discover Albania

unread,
Jul 29, 2015, 1:09:15 PM7/29/15
to floreysoft, wel...@zbulo.org
Hello Daniel, still won't work. I use the exact code but it always loads the first row, not the last one. 
Would be happy if you can advise. Thanks! 

var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var lastRow = sheet.getLastRow();
var response = UrlFetchApp.fetch('http://www.ultradox.com/run?id=XYZ&chunk='+lastRow);

maxime...@sygma-tech.com

unread,
Jun 13, 2016, 11:41:56 AM6/13/16
to floreysoft
Hi Daniel. I've made also a script :


function myFunction() {

var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var lastRow = sheet.getLastRow();

}

to get the last row as value.

I don't have knowledge in Google Apps for Script but my objetive is to lauch the Ultradox each time a user add a row (trigger) without using a Google Form. 

Could you help me ?
Thanks,
Maxime Petit

Kyle Lacey

unread,
Jun 27, 2016, 1:26:52 PM6/27/16
to floreysoft
OMG yes, please help! I've created several lovely JotForms and have spent hours looking for a way to the trigger Ultradox flow upon submission.

Zbulo! Discover Albania

unread,
Jun 28, 2016, 3:40:30 AM6/28/16
to floreysoft
Same goes for more, very much appreciated, I'm not sure how to make the webhook select the last row or to add a search query for the load worksheet block - it's described in the FAQ but when I click the gear icon to access options there's no possibility to enter such. Thanks!

Kyle Lacey

unread,
Jun 30, 2016, 7:11:45 AM6/30/16
to floreysoft

If you'd like to use JotForm, Formstack, Zapier, etc. or any other Form, other than Google Forms to Trigger an Ultradox, you'll struggle as I have for the last 2 days putting together a proper solution to this question that was first asked in Nov 2012.

This solution will be tailored for a JotForm to Ultradox Trigger.

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 > Click Create and Rename to "Trigger" > Replace lines 1 to 78 with the code below:

// The following method will be invoked whenever Ultradox executes the script
function execute(mode1) {

  var sheet = SpreadsheetApp.openById('1KFVcrrCpiPKn7pOz2sQoI5IPjiPNlNKuHpykhlKA0fY').getSheetByName('Submissions');
//Change the sheet Id and name as appropriate
   var lastRow = sheet.getLastRow();

   var response = UrlFetchApp.fetch('http://www.ultradox.com/batch?id=x5OPzk9iQ5LssjaeEgxScBMqXA3Pnc&chunk='+lastRow);}

From the Script editor, On line 4, change the Sheet ID (to your response sheets ID, found in its URL) and the name of the Sheet tab inside the Spreadsheet the responses are on (not the name of the Spreadsheet) > go to the Ultradox you want Triggered > Click File > Integrate > copy your Integration URL > Back to the Script, Replace the URL on line 9, "&chunk=" is part of the script and needs to stay at the end of your URL.

Click Publish > Deploy as web app > change Who has access to the app: to Anyone > Deploy > Copy the Current web app URL.

Return to the Trigger Ultradox and click the Gear icon on the Script Block (if unavailable, delete this block, add another Script Block, click Select, find and associate the script you created with this Block) paste the 'app URL' to 'Enter published script URL > OK > Click File > Integrate > copy your Integration URL.

Go to JotForm and Open the custom 'Thank You' page > Insert/edit image > paste the Integration Link from the Trigger Ultradox in the Source > OK > Resize the new box to something very small. Be aware that as this point every time you open the Thank You page your Ultradox will be Triggered :-)

Summary of flow... JotForm is submitted > Thank You page Triggers the Trigger Ultradox 1 min timer > Form data is written to sheet > The Trigger Script gets the last row number from your sheet > The script appends this row number as a 'Chunk' to the Ultradox Integration URL before Triggering the integration.


Would you like to place the Trigger script inside the Ultradox you'd like Triggered, rather than having it as a separate Ultradox?
You'll have to work out how to pass the "lastRow" variable from the Trigger Script to the "Pick row(s)" building block. As this would sit above your work flow, you'll also have to work out an "Execute only if the following condition is true" for the Trigger Script, so you may trigger other rows without the script interfering.

Alfonso

unread,
Sep 21, 2016, 3:31:26 PM9/21/16
to floreysoft
This is a very useful script. I set it up and it ran. I had to change the
&chunk='+lastRow);}

with

?chunk='+lastRow);}


The ONLY problem I am having is that it is not picking up the Last Row. In fact, it doesn't pick anything up from the sheet, but it triggers the document workflow generating a document with no data. 

I opened this case in the forum, but I haven't heard from Daniel yet...so I'm a bit at a loss here. :( any help is appreciated.

Daniel Florey

unread,
Sep 21, 2016, 3:34:00 PM9/21/16
to floreysoft GmbH
Did you move the timer *before* the script?
It needs to wait before running the script in order to get the proper data from the sheet.
I'm available tomorrow to check your setup if you cannot get it to work

Regards,
Daniel

--
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.

Daniel Florey

unread,
Sep 21, 2016, 3:34:51 PM9/21/16
to floreysoft GmbH
..and is your final script running correctly if you hit the "Run batch" button and select one of the rows manually?

Alfonso

unread,
Sep 21, 2016, 3:59:50 PM9/21/16
to floreysoft
great question!

I hit the "Run batch" button and selected the last row manually and it works fine. It generated the document properly.
15:54:37Loaded 1 rows from worksheet...



When i hit "Run" button by itself, then it generates a blank document with no data.
15:53:53Loaded no rows from worksheet...

Attached is my Google Sheet Block as it is setup in my final script.

I know about the timer, I set it up, but at this point i'm just running the Trigger by itself to confirm that it is in fact picking the LastRow, but it is not.



To unsubscribe from this group and stop receiving emails from it, send an email to floreysoft+...@googlegroups.com.
Screen Shot 2016-09-21 at 3.58.01 PM.png

Alfonso

unread,
Sep 21, 2016, 4:13:01 PM9/21/16
to floreysoft
Is this script supposed to be configured to "Run Batch"?

if so I think the command may be wrong

Currently I have this:

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

Shouldn't the command say:

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

Maybe that's the problem...I was checking this url http://help.ultradox.com/en/reference.html#batch


On Wednesday, September 21, 2016 at 3:34:51 PM UTC-4, Daniel Florey wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to floreysoft+...@googlegroups.com.

Alfonso

unread,
Sep 21, 2016, 4:37:33 PM9/21/16
to floreysoft
So I tried running this command in the script
   var response = UrlFetchApp.fetch('http://www.ultradox.com/run/6VbYGN7gDDOf4MvFcAT2808ricy8bW?chunk='+lastRow);

And I got this response - LOADED NO ROWS 

16:29:37Loaded no rows from worksheet Pagare-Entries of spreadsheet Pagare-EASY-PAGARE


Then I changed the script for the following script:
 var response = UrlFetchApp.fetch('http://www.ultradox.com/batch?id=6VbYGN7gDDOf4MvFcAT2808ricy8bW&chunk='+lastRow);

And got this response - LOADED 1 ROWS

16:22:58Loaded 1 rows from worksheet Pagare-Entries of spreadsheet Pagare-EASY-PAGARE

BUT IN BOTH SCENARIOS my document came back blank.
I think Batch is picking a row, I don't know if it is picking the last row as the blank row...
So I deleted all the blank rows in the Google Sheet to see if it is picking up the LastRow...but it still doesn't load anything. 

Alfonso

Alfonso

unread,
Sep 22, 2016, 8:50:25 AM9/22/16
to floreysoft
Hi Daniel. I still need help. I hope you can assist me to check my setup and figure out what's wrong. 

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

Daniel Florey

unread,
Sep 22, 2016, 8:55:58 AM9/22/16
to floreysoft GmbH
Hi,
can you please download and start the remote support tool and send me the session code when you are online?

http://get.teamviewer.com/floreysoft

I'll then have a look and will try to help you.

Thanks,
Daniel


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

Admin Easy Legal Peru

unread,
Sep 22, 2016, 9:29:02 AM9/22/16
to flore...@googlegroups.com
Hi Daniel, 
I'm online and ready. 

Thanks!
Alfonso

--
You received this message because you are subscribed to a topic in the Google Groups "floreysoft" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/floreysoft/Psz0N1O7Bz4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to floreysoft+unsubscribe@googlegroups.com.

Daniel Florey

unread,
Sep 22, 2016, 9:34:24 AM9/22/16
to floreysoft GmbH
Can you please use the version from the link (Version 9)?

..or from here:

Message has been deleted

Daniel Florey

unread,
Sep 22, 2016, 10:34:12 AM9/22/16
to floreysoft GmbH
Ok, I'm back!

2016-09-22 15:46 GMT+02:00 Admin Easy Legal Peru <ad...@easylegal.pe>:
289 747 453
9952

Done. :)

Alfonso

unread,
Sep 22, 2016, 5:26:45 PM9/22/16
to floreysoft
Ok, so here's the correct code to make this work as intended.
Make sure there are no blank rows at the end of your Google sheet. Solution Courtesy of Daniel Florey.

// The following method will be invoked whenever Ultradox executes the script
function execute(mode1) {



 
var sheet = SpreadsheetApp.openById('YOURGOOGLESHEETID-FOUND-IN-GOOGLESHEET-LINK').getSheetByName('YOUR-GOOGLE-SHEET-TAB-NAME');

//Change the sheet Id and name as appropriate
   
var lastRow = sheet.getLastRow();

   
var response = UrlFetchApp.fetch('http://www.ultradox.com/batch?id=YOUR-ULTRADOX-INTEGRATION-KEY&chunk='+lastRow);
 
return {
    executionReport
: "Ultradox has been triggered with last row="+lastRow
 
}
}




On Thursday, June 30, 2016 at 7:11:45 AM UTC-4, Kyle Lacey wrote:

AJ Longo

unread,
Sep 29, 2016, 6:21:20 PM9/29/16
to floreysoft
Where do you place that code? 

Sheldon Bernstein

unread,
Nov 26, 2016, 8:59:40 AM11/26/16
to floreysoft

@ AJ, You would open SCRIPT EDITOR under TOOLS within the Google Sheet you wish to have the code run. 

Sheldon

Admin Easy Legal Peru

unread,
Jun 21, 2017, 3:20:17 PM6/21/17
to flore...@googlegroups.com
Daniel,
How are you?
Our ultradox product has been working perfectly until today. Every time we try to preview a document on Google Docs using the Ultradox Template Editor, we get this message:

{ "steps": [ { "timestamp": "Jun 21, 2017 7:19:20 PM", "success": true, "message": "Loaded 1 rows from worksheet poder-amplio of spreadsheet Poder-Amplio-EASY-P-AMPLIO", "imageUrl": "spreadsheetLoadRow.png", "properties": {} } ], "consumedLicense": 1789, "maxLicense": 25000 }


The url that generates this message is:

Alfonso

Screen Shot 2017-06-21 at 1.56.50 PM.png

Daniel Florey

unread,
Jun 21, 2017, 6:02:36 PM6/21/17
to floreysoft GmbH
Could you please check if the you still get the error?
We've reverted back to a previous version...

q...@obviumq.com

unread,
Sep 9, 2017, 6:02:13 PM9/9/17
to floreysoft
I have the same problem... Everything works fine without errors, however, a document coming out empty. Anybody can help?


Reply all
Reply to author
Forward
0 new messages