Skip to main content
In this function, you can process the data returned by the API. Click the button to see the initial function body as shown below. The first parameter data is the returned data. Write JavaScript to process data and return the result. Example: Suppose the API returns the data below. You need to process the Numerical column: return 0 when the value is less than or equal to 0, and return 100 when the value is greater than 0. First, examine the data section of the API. data is an array. The example below contains 4 items, corresponding to 4 records in the Spreadsheet. Each item contains 2 data values, corresponding to the 2 data values in each record. Next, determine which of the 2 values corresponds to the Numerical field. In this example, since the data formats of the Numerical field and the Modified time field are clearly different, you can tell at a glance that field_kr1zcs45 corresponds to the Numerical field, and field_kr1zcs49 corresponds to the day_Modified time. If the dataset is large and hard to identify at a glance, analyze it using the meta field. Locate the item whose aliasName contains “Numerical”; its fieldId is field_kr1zcs45. Finally, process the data.