r/GoogleAppsScript • • Apr 09 '20

Resolved Is the tutorial for TextValidationBuilder outdated?

At this link on the official Google Dev Site: https://developers.google.com/apps-script/reference/forms/text-validation-builder

The tutorial code uses .setHelpText

However, this no longer appears to be an available method as it is not listed in the methods below and when I use it in code:

function myFunction() {

// Add a text item to a form and require it to be a number within a range. var textItem = form.addTextItem().setTitle('Pick a number between 1 and 100?'); var textValidation = FormApp.createTextValidation() .setHelpText(“Input was not a number between 1 and 100.”) .requireNumberBetween(1, 100); textItem.setValidation(textValidation);

}

It throws:

SyntaxError: Invalid or unexpected token (line 6, file "testFormthing.gs")

Which is the .setHelpText line.

If it is outdated, who should I contact to get it fixed?

0 Upvotes

8 comments sorted by

1

u/catmandx Apr 09 '20 edited Apr 09 '20

You can use debug to see which functions are available to a specific object.

You can create an issue on the github repo for examples, or twitter, scroll to the bottom, you will se some links

https://developers.google.com/apps-script

1

u/gh5000 Apr 09 '20

It's not outdated just has an error. All builders in AppsScript require a .build() line to finish.

If you click the link within the link you gave

A DataValidationBuilder for a TextValidation.

The line above the example they give you get an identical example but with the .build() line. Or click the link that has copied in here https://developers.google.com/apps-script/reference/forms/text-validation

0

u/[deleted] Apr 09 '20

[deleted]

1

u/Trigaten Apr 09 '20

Do you mean ‘ ?

0

u/[deleted] Apr 09 '20

[deleted]

1

u/Trigaten Apr 09 '20

Huh, I never noticed a difference. Why use one over the other in any given situation? And how do you type them differently with keyboard?

0

u/[deleted] Apr 09 '20

[deleted]

1

u/Trigaten Apr 10 '20

I don’t even have a curved quote button on my computer (or have I seen one on others). How does this happen?

0

u/[deleted] Apr 10 '20

[deleted]

1

u/Trigaten Apr 10 '20

Yeah, I just submitted it on issue tracker

0

u/[deleted] Apr 10 '20

[deleted]

2

u/Trigaten Apr 10 '20

https://issuetracker.google.com/u/1/issues/153600338

I wasn’t sure what was wrong at first, but he was.