Ruud Mantingh
Ruud Mantingh

Reputation: 33

How to set up a data profile for APEX 21.1 REST Data Source with no row selector available

I'm using APEX 21.1 and have created a REST Data Source for a web service that returns a response in the following format:

[
  [
    1499040000000,      // A time stamp
    "0.01634790",       // A value
    .... etc.
  ],
  [
    1499040000100,      // A time stamp
    "0.01634799",       // A value
    .... etc.
  ]
]

The auto-discover function complains about not finding a row selector. How do I manually set up a data profile for such a type of response?

Thanks, Ruud

Upvotes: 3

Views: 1935

Answers (1)

Carsten
Carsten

Reputation: 1124

Since this JSON structure is just a nested array, APEX cannot auto-discover that Data Profile. You can get it working as follows:

  • In the Create REST Source Wizard, use the "Create Module Manually" button
  • Edit the new REST Data Source
  • Click the Edit Data Profile button. You should see 3 pre-created columns.
  • Change the Row Selector to . (a dot)
  • Edit the first column
    • Change the column name to TIME_STAMP
    • Change the selector to [0]
    • Change the data type to NUMBER
    • Save the changes
  • Edit the second column
    • Change the column name to VALUE
    • Change the selector to [1]
    • Change the data type to VARCHAR2
    • Save the changes
  • Delete the third column
  • Save everything.

You should now be able to test the REST Data Source.

Does that help?

Upvotes: 4

Related Questions