When you submit a form, the FormResponse object contains all your responses. To get the answer for a specific form item, like a CHECKBOX_GRID, you use the getItemResponses() method on the FormResponse object.
The key to a CHECKBOX_GRID is that the getResponse() method returns an array of arrays, not a simple string or a flat array of strings. Each inner array corresponds to a row in the grid and contains the column titles of the selected options for that specific row.
For example, a grid with rows "X-Small," "Small," and "Medium," and columns "White" and "Navy."
If you selects "Navy" for the "X-Small" row, selects nothing for the "Small" row, and selects both "White" and "Navy" for the "Medium" row, the getResponse() method would return: [['Navy'], [], ['White', 'Navy']] or as string Navy,,White,Navy.
The first inner array ['Navy'] represents the selections for the "X-Small" row.
The second inner array [] is an empty array and represents the "Small" row, where no checkbox was selected. This is the correct way to handle unselected rows, not by returning null or an empty string ''.
The third inner array ['White', 'Navy'] represents the selections for the "Medium" row, showing multiple choices within a single row.