CardService.newTextInput not rendering for some users

143 views
Skip to first unread message

Paul Nerie

unread,
Apr 24, 2023, 9:45:38 PM4/24/23
to Google Apps Script Community
I have Gmail add-on, and text input is not rendering for some users.

I've posted this problem in Stackoverflow:
Google Apps Script CardService.newTextInput does not show for one user - Stack Overflow

Basically this code 
var cardMain = CardService.newCardBuilder().setHeader(CardService.newCardHeader());

cardMain.addSection(CardService.newCardSection()
.setHeader("Test")
.addWidget(CardService.newTextInput()
  .setFieldName("paultest")
)
);
 return cardMain.build();

Just shows this:

Instead of this:

Setting multiline=true, shows different appearance for different users. This is using the same Chrome browser (different profiles) on the same computer:

The one on the left is where the text input with multiline=false works.

Does anyone know what the problem is? It appears to be account related and not device or browser specific.

Thanks in advance!

Yufan Shi

unread,
Apr 25, 2023, 2:38:58 AM4/25/23
to google-apps-sc...@googlegroups.com
Hey there,

I noticed that the UI library in GWA has been experiencing some strange bugs lately. It seems that the checkboxes in my app aren't showing up, and some components are appearing larger and less attractive than usual. Additionally, there have been some issues with certain buttons not functioning properly.

This email and any files transmitted with it contain confidential information and is intended only for the individual to whom this is addressed. If you received this by mistake, please notify the sender immediately by e-mail and delete this from your system. Read more about 1902 Software Development’s Privacy Policy.


We don’t have work on April 21 (Friday) due to a national holiday. Work resumes on April 24 (Monday). For emergencies, please send your email to sup...@1902.software (this is the only email that’s monitored during holidays).

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/cfc9fb98-8def-470a-926f-c01589a378b9n%40googlegroups.com.

Paul Nerie

unread,
Apr 25, 2023, 3:35:05 AM4/25/23
to Google Apps Script Community
In my case the 'workaround' is setting multiline to true. 

I found another issue though with switch controls. In the snippet below, removing the '.setValue(false)' from the code causes two errors:
1. The action is not triggered
2. the formInputs does not 'see' the values of the switch control that are selected/true. It always return as null

cardMain.addSection(CardService.newCardSection()
    .setHeader("test section")
    .addWidget(CardService.newTextInput()
      .setFieldName("testinput")
      .setTitle("test input")
    )
    .addWidget(CardService.newDecoratedText()
      .setText("Test switch")
      .setSwitchControl(CardService.newSwitch()
        .setControlType(CardService.SwitchControlType.SWITCH)
        .setFieldName("testswitch")
        .setValue("switcher0")
        .setSelected(false)
        .setOnChangeAction(CardService.newAction().setFunctionName("testswitch"))
      )
    )
    .addWidget(CardService.newDecoratedText()
      .setText("Test switch")
      .setSwitchControl(CardService.newSwitch()
        .setControlType(CardService.SwitchControlType.SWITCH)
        .setFieldName("testswitch")
        .setValue("switcher1")
        .setSelected(false)
        .setOnChangeAction(CardService.newAction().setFunctionName("testswitch"))
      )
    )
  )

Frustrating how Google makes this 'inconveniences'.

Brad Kaes

unread,
Apr 25, 2023, 11:40:53 AM4/25/23
to Google Apps Script Community
I added an official issue https://issuetracker.google.com/issues/279506028 

Experiencing the same thing

Paul Nerie

unread,
Apr 25, 2023, 7:33:57 PM4/25/23
to Google Apps Script Community
Thank you!
Reply all
Reply to author
Forward
0 new messages