New_2_Code
New_2_Code

Reputation: 328

Return a value from Calculated Model Table in Google App Maker

I have a Calculated Model which generates records based on a query. When I click the update button I want to pull the Certificate_ID Value in the same row as the Update Button. First thing I have tried to do is return the index of the row using by attaching the following code to the Update Button's on click event. Tried using the below code, but not getting the desired result.

Returns the position of the of the button in the row:

var index = widget.childIndex;

Returns blank on the first button and returns 1 for the second button:

var index = widget.parent.childIndex;

Table in App:

enter image description here

Table with Data:

enter image description here

Upvotes: 0

Views: 186

Answers (1)

Markus Malessa
Markus Malessa

Reputation: 1831

For calculated datasources you are still able to use:

widget.datasource.item.YourField

in a button onClick event to get a value from the button click.

Upvotes: 1

Related Questions