Trying to get CDT mapped to a view

Pulling my hair out. I m trying to create a CDT mapped to an existing view in my application's mySQL database. Doing my best to follow these instructions: https://docs.appian.com/suite/help/20.2/Mapping_CDTs_to_Pre-defined_Database_Tables.html. I cannot seem to add it as an Entity to a data store though; it seems the DDL is trying to create a table, but I just want to map to a view ...

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    If you're just trying to create a new CDT based on an existing table/view, there shouldn't be a step in the process where any DDL needs to come into it.  It's pretty straightforward...

    1. click "new" -> "data type"
    2. select "create from database table or view" radio button
    3. select the data source and the view name, click next
    4. the "create data type" form pops up with all the pre-populated column names;
      1. the only catch here is that you need to force a primary key column by clicking on the "key" icon and selecting "primary key"; you need to do this even if it's not really a primary key (in a view at least), though for querying reasons i'd strongly suggest you make sure there's at least one column that will basically always have unique values under nominal conditions
      2. otherwise, just give the CDT a name (i suggest not using the pre-populated one), and select the Data Store
    5. click "create"

    That's really all it takes.  I'm running through it as I type this to make sure.  No DDL files involved - where are you  seeing that?

  • As I have done this several times, I was told that after doing what you suggest, that I open the Datastore ,Verify and then Save and Publish as the final step. Is this necessary? or am I doing an unnecessary step?

  • 0
    Certified Lead Developer
    in reply to Edward Anthony Allen

    You can open the datastore and verify, but only as a precaution / to double check.  When things are working normally AFAIK this is an unnecessary step.