Skip to content

Large Parameters in Actions

When implementing APIs, there could be a need to pass large parameters. To make sure the OData Provider containers do not run into out-of-memory issues due to the extra-large parameters sent in, we limit the maximum size allowed for a single parameter to 64 KB both in actions and functions.

For file uploads, the supported approach is to model stream type attributes in a Projection Entity and stream the content directly to the attribute endpoint. Stream type attributes can be modelled for both BINARY and LONG_TEXT types in entity models, so applications can transfer large payloads directly into the tables using this mechanism.

If a large binary or text content is required to be further processed before being saved into the database tables, it is convenient to define an action endpoint to take in the context along with other parameters. Without the absence of a direct approach to take in a stream along with the other parameters in OData Provider, we have to do a multi-step API invocation to pass large content to Projection Actions (both Bound and Unbound).

Following are the steps to execute this action.

  1. Create a record inside the FndTempLobs entity set and retrieve the OData-EntityID response header value.
  2. Send in the stream content into {{OData-EntityID}}/BlobData or {{OData-EntityID}}/ClobData depending on the type.
  3. Call the real action with the OData-EntityID retrieved earlier. In place of the parameter you need to have the real data content. Note that the action endpoint has a slightly changed parameter name from the one you model (ParameterName -> ParameterNameTempLobId).

At the server-side Action implementation, the real data content will be available as a BLOB or CLOB depending on your action parameter type of Binary or LongText respectively. You don’t have to worry about clearing the temporary data for fetching the content in the real Action implementation.

Refer this sample projection model and Postman collections to see this in action. Note the usage of "Tests" configuration in the first request to extract OData-EntityId and ETag as Environment Variables and their usage in the subsequent two requests.