1

I am fairly new to Google App Maker and I am not sure if this is even possible. I am trying to call an external service based on an ID entered into an input, then display the results dynamically as a list of checkboxes.

I have successfully been able to enter an ID, call my database through JDBC in a server script, and display the returned value from that ID onto the page. But what I really want to do is enter the ID, which calls my database and returns an array of objects (which I won't know the length of until returned), then for each item in my array, dynamically create a new checkbox row with each objects data.

I have been looking around for a solution to this, but can't find any example of widgets being dynamically created. I didn't see anything in the Google App Maker documentation about creating a widget from a script, and wasn't sure if this was possible yet. I was hoping this would be possible with the Accordian widget, as I liked that the rows can be expanded and collapsed, but not sure if I can add radio buttons to an Accordian or not. Even a group of Radio buttons would work as well. Any ideas would be a big help!

MattMcCode
  • 187
  • 4
  • 18

1 Answers1

2

You need to use Calculated Model. Once you have it you can bind its datasource to a List, Grid or Accordion widget where you can add any other widget (even checkbox!) to its prototype row/cell. External Database Sample could be a good starting point since you are reading data from external database.

From the question it is not clear what do you want to do with the checkbox further, but I think reading about page Custom Properties, Checkbox Events and Apps Script RPC could be useful.

Pavel Shkleinik
  • 6,298
  • 2
  • 24
  • 36
  • Thanks for pointing me in the right direction! Once I get the list populating to the page, I am trying to then allow the user to select from the list which items they would like, which would trigger an API post of the selected data to another system. – MattMcCode May 31 '18 at 16:54
  • https://stackoverflow.com/a/48432677/454137 - this answer could be useful as well – Pavel Shkleinik May 31 '18 at 17:03
  • That is actually very helpful, thanks @Pavel Shkleinik! – MattMcCode May 31 '18 at 17:48