1

I am trying to create a form in Google app maker and want to populate certain values from the data source but I have a very little idea on how to proceed with it.

I am trying this solution

function fetchdata() {
  var query = app.models.aq.newQuery();
  query.filters.email._equals=Session.getActiveUser().getEmail();
  var allRecords = app.models.aq.newQuery().run();
  console.info(allRecords);
}

it is giving me these errors

{ 
  "serviceContext": { 
    "service": "AKfycbx9DoVPosC5I4ku0Pa75POroOGmZ7xML5juPHfnWhghrc5TrqhFY2Cm" 
  }, 
  "message": "Exceeded maximum stack depth\n" 
}

Executing query for datasource GET_DATA: (Error) : Exceeded maximum stack 
depth at Main.Container.onAttach:1:26

Executing query for datasource GET_DATA failed.
John Scattergood
  • 1,032
  • 8
  • 15
Ishan
  • 111
  • 4
  • As stated in this [thread](https://stackoverflow.com/a/6095695/5832311), you are likely getting this error because somewhere in your code, you are calling a function which in turn calls another function and so forth, until you hit the call stack limit. In order to fix it, ensure that your recursive function has a base case which is able to be met. Also, this [thread](https://stackoverflow.com/questions/37398722/exceeded-maximum-stack-depth-in-a-custom-function-for-google-sheets#comment62309499_37398722) also suggested to avoid recursion (using a loop). – abielita Jul 03 '17 at 14:03
  • Can you still reproduce the issue? Do you use Drive Table or Cloud SQL as databackend? Does your model have any relations? – Pavel Shkleinik Feb 27 '18 at 23:50

1 Answers1

0

Try to rename your variable to something else than "record", for example app maker can't update a CloudSQL field with the name "record"

For populating data to a form: add a form from Widgets and connect your datasource. Populate your data in the field: value.