2

Currently, AFAIK, when performing google form batchUpdate using the google forms API v1, we are only able to set the shuffle property of choiceQuestions, while for textQuestions there are no options to set the response validations, like if I want to use regex match as validation.

For Example, the request body looks like this:

{
  "requests": [
    {
      "createItem": {
        "item": {
          "questionItem": {
            "question": {
              "choiceQuestion": {
                "shuffle": false
              },
              "textQuestion": {
                "paragraph": false
                  /*no other parameters to set*/
              }
            }
          }
        }
      }
    }
  ]
}

Am I missing something? Or is this feature not implemented yet?

Marlon Dumal-is
  • 300
  • 2
  • 13

1 Answers1

1

You are correct, this has not been implemented yet. For now, these are the only options that can be used with ChoiceQuestion This is kind of expected taking into consideration FORMS API was launched just last month.

So you may want to submit a Feature Request for that missing feature.

In the meantime, you can also consider tackling this using Google Apps Script and its Forms Advanced Service which includes response validation.

Yancy Godoy
  • 582
  • 2
  • 13
  • So, would it be possible to create a `Google App script` with some `Forms Advanced Service` operations and then run the script using `Google App Script API`? – Marlon Dumal-is Apr 08 '22 at 06:53
  • Yes, you can create a ```Google App Script``` with the ```Forms Advanced Service``` and run it using the Google Apps Script API, you can see more details [here](https://developers.google.com/apps-script/api/reference/rest) – Yancy Godoy Apr 11 '22 at 16:24
  • @YancyGodoy can plese explain little more i'm trying to get regex from google form api for a making chat bot – abhijith v Dec 23 '22 at 03:20
  • @MarlonDumal-is how you implement form api and app script together can you expain – abhijith v Dec 23 '22 at 03:25
  • @abhijithv as the comments imply you'll have to learn more about Google App Script API, you basically create an appscript function and run that externally through Google App Script. It's kind of hard to explain through comments. Best way to understand what we were discussing is by learning about google Apps script 1st. – Marlon Dumal-is Dec 31 '22 at 05:58
  • @MarlonDumal-is can you suggest some doc or video releted to this topic I'm tring to get google form questions regex from api so I can make a bot and validate all qestion that user answer – abhijith v Dec 31 '22 at 06:00
  • @MarlonDumal-is is your project is open source can i have your github link to refer how to implement this – abhijith v Dec 31 '22 at 06:01