# getFieldValue

## Parameters

1. controlId => String with the control id. Some controls (like Comboboxes) do have sub information. in that case the controlId is combined with a ".". e.g. comboBoxId.subcontrolId

## Example Usages

```javascript
let myText = "Hello World!";
app.setFieldValue("myControlId", myText);
value = app.getFieldValue("fieldId");
```

```javascript
let myFieldId = "fieldId";
let value = app.getFieldValue(myFieldId);
```

```javascript
let itemId = app.getFieldValue("itemCombobox"); //like any other control
let taxKeyId = app.getFieldValue("itemCombobox.itmTaxKeyId"); //get the itmTaxKeyId value of the selected entry in acomboBox
let itemName = app.getFieldValue("itemCombobox.itmName");
```

```javascript
let taxKeyId = app.getFieldValue("itemList").itmTaxKeyId; //get the itmTaxKeyId value of the selected entry in a grid
let allRowsFromMyGrid = app.getFieldValue("itemList.allRows"); //get an array of all rows in a grid
```

```javascript
let selectedRowsFromMyGrid = app.getFieldValue("itemList.selectedRows"); //get an array of all selected rows in a grid
let unselectedRowsFromMyGrid = app.getFieldValue("itemList.unselectedRows"); //get an array of all unselected rows in a grid
let myRowJsonObject = app.getFieldValue("itemList.clickedRow"); //get the clicked row as a json object (only valid in onRowClick and onCellClick events)
let myCellValue = app.getFieldValue("itemList.clickedCell"); //get the clicked cells formatted value (only valid in onCellClick events)
let myCellId = app.getFieldValue("itemList.clickedCellId"); //get the clicked cells id (only valid in onCellClick events)
```

```javascript
for (let i = 0; i < allRowsFromMyGrid.length; i++) {
  console.log(allRowsFromMyGrid[i].itmTaxKeyId);
}
```

<pre class="language-javascript"><code class="lang-javascript">// Calendar
let type = app.getFieldValue('calendar.view.type');
let title = app.getFieldValue('calendar.view.title')
<strong>let activeStart = app.getFieldValue('calendar.view.activeStart');
</strong>let activeEnd = app.getFieldValue('calendar.view.activeEnd');
let currentStart = app.getFieldValue('calendar.view.currentStart');
let currentEnd = app.getFieldValue('calendar.view.currentEnd');

/*
    type             dayGridMonth
    title            September 2024
    activeStart      2024-09-03T00:00:00
    activeEnd        2024-10-13T00:00:00
    currentStart     2024-09-01T00:00:00
    currentEnd       2024-10-01T00:00:00
*/
</code></pre>

For further information: [Calendar Control](https://gebra-it.gitbook.io/wiki/controls/fullcalendar#access-information)

### Return Values

The getFieldValue function returns the value of a form control specified by the controlId.
