Skip to main content
August 17, 2021
Solved

Database View In A Web API

  • August 17, 2021
  • 3 replies
  • 0 views

I'm trying to expose a view from the Appian DB via a Web API. 

The Web API requires a Data Store Entity Constant. So I try to create a constant with a Data Store Entity type, but I need a Data Store Entity created with the View Data Type. I create the view data type without issue and add it to the Data Store but it will not save and publish (I get a 'Appian.vwMyView' is not of type 'BASE TABLE' (APNX-1-4178-000) error). Also I do not want the view created as a table as it is already created in my DB as a View. How would I add an existing view into a Data Store? 

Best answer by alexl0007

I realized that the CDT definition needed to have a a unique identifier as this link explains: https://community.appian.com/discussions/f/process/5818/having-trouble-getting-my-data-store-for-views-to-map-a-data-type-to-an-existing

I edited my CDT and added a primary key to one of my columns (a unique column) and it worked. 

3 replies

stefanhelzle0001
Brainy
August 17, 2021
alexl0007Author
August 17, 2021

I looked at that but didn't see anywhere that a view needed to have a unique identifier as well in order for it to be added to a Data Store.

alexl0007AuthorAnswer
August 17, 2021

I realized that the CDT definition needed to have a a unique identifier as this link explains: https://community.appian.com/discussions/f/process/5818/having-trouble-getting-my-data-store-for-views-to-map-a-data-type-to-an-existing

I edited my CDT and added a primary key to one of my columns (a unique column) and it worked.