# SimConnect_RequestFacilityData The **SimConnect\_RequestFacilityData** function is used to request data according to a predefined object, an ICAO and a region.   ##### Syntax ``` cpp HRESULT SimConnect_RequestFacilityData( HANDLE hSimConnect, SIMCONNECT_DATA_DEFINITION_ID DefineID, SIMCONNECT_DATA_REQUEST_ID RequestID, const char * ICAO, const char * Region = "" ); ```   ##### Parameters {{< table-wrapper >}} | Parameter | Description | Type | |---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------| | `hSimConnect` | Handle to a SimConnect object. | Integer | | `DefineID` | Specifies the ID of the client defined data definition | | | `RequestID` | The client defined request ID | | | `ICAO` | Used to identify an airport, a VOR, an NDB or a waypoint. | | | `Region` | Additional identifier for an airport, a VOR, an NDB or a waypoint. For airports, this can be omitted without issue, however for VOR / NDB / Waypoints this should be supplied if possible, although there are workarounds provided if it's not (see remarks, below). | | {{< /table-wrapper >}}   ##### Return Values The function returns an **HRESULT**. Possible values include, but are not limited to, those in the following table. {{< table-wrapper >}} | Return value | Description | |----------------------------------------|------------------------------------------------------------------------| | `S_OK` | The function succeeded. | | `E_FAIL` | The function failed. | | `SIMCONNECT_EXCEPTION_UNRECOGNIZED_ID` | The function has an invalid `DefineId`. | | `SIMCONNECT_EXCEPTION_ERROR` | The function was supplied an invalid `ICAO` and/or `Region` parameter. | {{< /table-wrapper >}}   ##### Remarks If the Request works, the client will receive as many messages ([`SIMCONNECT_RECV_FACILITY_DATA`](../structures-and-enumerations/simconnect-recv-facility-data/)) as necessary to match the defined architecture. At the end, the server will send a [`SIMCONNECT_RECV_FACILITY_DATA_END`](../structures-and-enumerations/simconnect-recv-facility-data-end/) message to let the client know that everything is finished. For an example of use and more information, please see [`SimConnect_AddToFacilityDefinition`](simconnect-addtofacilitydefinition/).   Note that it is possible to request a Waypoint/NDB/VOR using only the ICAO and no region. When doing so, if there is *no* duplicated ICAO, then the appropriate data will be returned. However, if there is a conflict between multiple ICAO's, the function will return a list of possibilities (ICAO + Region) - using the [`SIMCONNECT_RECV_FACILITY_MINIMAL_LIST`](../structures-and-enumerations/simconnect-recv-facility-minimal-list/) structure - and then you can make the request again, including the region as well as the ICAO. Alternatively, you can use the [`SimConnect_RequestFacilityData_EX1`](simconnect-requestfacilitydata-ex1/) function which permits you to specificy a route point "Type" and only get the data that correspond to that specific point type.   ##### See Also - [SimConnect API Reference](../../simconnect-api-reference/) - [SimConnect\_AddToFacilityDefinition](simconnect-addtofacilitydefinition/) - [SimConnect\_RequestFacilitiesList](simconnect-requestfaciliteslist/) - [SimConnect\_RequestFacilityData\_EX1](simconnect-requestfacilitydata-ex1/)