Calling Experimental Code from server?

I would like to run various test cases against my experimental code that I have setup for my Glide App table.

Here is the code:
https://glide-next-day-next-week.dawso.repl.co
(You pass it a day of the week (e.g. “Wednesday”) and a date. It returns the date of next Wednesday after the given date).

The column is being populated in Glide with the correct values.

Now I would like to run various scenarios against this code to make sure it works correctly which is much simpler to do server side, than inputting vales into the Glide Table for all the possible cases.

How do I pass the parameters and call this function from a non-glide server?

Here is what I have tried:
var dayName = “Wednesday”;
var refDate = new Date(“10/01/2021”);
var formData = {
‘dayName’: dayName,
‘refDate’: refDate
};

var options = {
  'method': 'get',
  'body': JSON.stringify(formData),
};

options.headers = {
  'Content-Type': 'application/json'
}

// Service: https://glide-next-day-next-week.dawso.repl.co
var returnedData = UrlFetchApp.fetch("https://glide-next-day-next-week.dawso.repl.co/", options);

But this only returns the HTML in the index.html file Glide has you setup:

Glide Yes-Code

It’s up to you, but this would probably be fairly easy to set up using some date math without the experimental column. Might be more stable that way. Doesn’t help with your multiple test case scenario, but I think it would work well once it’s set up. I don’t have time right now, but in a day or two I could try to set something up if you’re interested.

2 Likes

Thanks - but my code works for the records in Glide. I just want to create a script to call my experimental code outside of Glide to run 100s of test cases.

1 Like

No problem. I don’t have any good ideas for mass testing, but maybe somebody else will. My only thought would be if you can somehow call the code from a google sheet script or duplicate the code in a script. You could maybe mass fill multiple dates and days of the week and let the script run. Just a random thought.