Skip to content

ODataService Read

Read action is used to send a read request to the target OData Service.

The result of the action can be accessed in the OnSuccess event and will be available in the ActionResult.data in the format of JSON String.

The properties defined in Action are also applicable to this action.

ODataService Read Properties

Property Type Required
Headers object Optional
Properties string[] Optional
RequestOptions RequestOptions Optional
Target QueryTarget Required
_Type const Required

Headers

Custom headers to be included as part of the request to the OData Service in key/value pair format

  • type: object

Properties

Names of the properties to be included in the query result. If not set, all properties will be returned. Complex and Binary property type is supported.

  • type: string[]

All items must be of the type: string


RequestOptions

Options for processing of data requests


Target


_Type

  • type: const

The value of this property must be equal to:

"Action.Type.ODataService.Read"

Action Result

Refer to the MDK Guide to understand what an action result is.

The success ActionResult of this action is a JS array containing the read entity collection. The failure ActionResult is an error message.


Examples

Read

{
  "_Type": "Action.Type.ODataService.Read",
  "Target": {
    "Service": "/MyMDKApp/Services/MyOData.service",
    "EntitySet": "Customers",
    "QueryOptions": "$filter=CustomerID eq '1234'"
  }
}

Read selected properties

{
  "_Type": "Action.Type.ODataService.Read",
  "Target": {
    "Service": "/MyMDKApp/Services/MyOData.service",
    "EntitySet": "Customers"
  },
  "Properties": ["CustomerID", "CompanyName"]
}