Creating new record using REST API results in empty response

If your Visual Builder instance is configured to use another Oracle DB, when you use the REST API to insert a new record in a table you might see a response that contains no data, even though the insert is successful and the call returns the expected status (HTTP 201).

This can happen when a business object has a primary key field defined as <column name> NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY ....

The workaround is to perform the following steps to modify the business object's primary key field:

  1. Open the application in Visual Builder.
  2. Open the business object you want to modify.
  3. Open the Fields tab.
  4. Select the primary key field.
  5. In the Sequence Name dropdown list, select the appropriate internal sequence used by the database to create new records in the table.

    If the database schema has only one table with an identity column, it should be clear which sequence to select (the sequence will have an internal looking name). If there is more than one table with an identity column, you can use the following query to locate the sequence the database created for the column:

    select data_default from SYS.user_tab_columns where table_name = <table name used by the BO> and column_name = <primary key field>;

After the Sequence Name property is set to the the correct sequence, Visual Builder will select nextval from that sequence before inserting the record into the table, and will use that value in the primary key column.