Skip to main content
manjit.1486
April 22, 2024
Question

Create Record type from SQL View

  • April 22, 2024
  • 13 replies
  • 0 views

Hello,

Could anyone guide me how to create record type from View table?

Thanks

    13 replies

    mathieud0001
    April 23, 2024

    Just choose database as the source but don't enable data sync.

    docs.appian.com/.../configure-record-data-source.html 

    manjit.1486
    April 23, 2024

    Thanks. I just disabled the related feature and it worked. But how it will refresh without sync if new data enters into view table?

    christineh465186
    April 23, 2024

    Non-synced records are what I call real-time records. They are not in the cache. So a real-time record that is backed by a view is queried as it is accessed. So, write to the base tables using either write records or write to datastore or.... As long as the base tables are updated (and the view is not materialized on a schedule) it will get the latest data.

    shubhama926776
    Brainy
    April 23, 2024

    Hello [mention:734d485eba7242aeab9bb03aafa409b0:e9ed411860ed4f2ba0265705b8793d05] 
    While creating record type select source type as Database
    Make sure to select disabled sync and related feature.
    Select view from respective data store.

    https://docs.appian.com/suite/help/24.1/Create_a_Record_Type.html

    शुभम्
    manjit.1486
    April 23, 2024

    Thanks. I have disabled sync and related feature. It worked. But one more thing.. 
    What if new data enters into view table- how it will refresh in record?

    karumurua531442
    April 23, 2024

    hi [mention:734d485eba7242aeab9bb03aafa409b0:e9ed411860ed4f2ba0265705b8793d05]   go to appian designer, create a new record type, once record is created you will find the below UI : then click on tell us about your data

    Then click on database

    After that, select disable data sync option and click on next,: If you enable and move forward you will be unable to find your view, view will not be found seen when data sync is enabled

    The you can browse or search your view name and finish creating the record type:

    manjit.1486
    April 23, 2024

    Hi. I already did this but view is not coming up in search or browse option. That's why I am curious- how to create record from view table. I just disabled sync and related feature and it works. Thanks for getting back to me

    karthikk538
    April 23, 2024

    1.  As far I understand , if we create with disable sync feature , it may not be of that useful and performance efficient as indirectly it queries the data from table/view, as nothing is cached.

    2. As view is in memory that's the reason they might have disabled the sync feature for this.

    3. I would suggest better to create view using record types with sync enabled, instead of querying the view using record. Again up to your use case, just check which is better suits you.

    4. Try checking the performance of all the three, querying the record type built on view with disable sync, querying the view using query entity, build view using record types with enable sync.

    Just curious to hear the feedback of #4 for your use case.

    harshk1671
    April 23, 2024

    I suggest to go with 'build view using record types with enable sync'. This will give you best performance among all the options as database view cannot have index and a query has to run on all the rows of database view. Avoid using database view.

    stefanhelzle0001
    Brainy
    April 23, 2024
    database view cannot have index

    Not sure whether I would go with that, but in general, avoiding database views is a good thing.

    stewart.burchell
    April 23, 2024

    For what it's worth I think it's a "horses for courses" debate. There's nothing inherently evil about Views (we got along with them fine for decades!). The performance red flag might be a false flag - a View doesn't necessarily equate to "poor performance" (a badly written View and/or Views that use tables that are poorly indexed might perform badly of course - but they might not!).

    Another way of looking at this is that the whole purpose of Record Relationships in Appian is to emulate "joining tables in a database" and what are Views if not two or more tables joined together so that normalized data is brought together in one convenient place for use?

    So (in short) you could do the following;

    • examine the View that you're wanting to bring into Appian as a Record
    • create Records for each of the tables that the View is composed of
    • add the relevant relationships between those Records
    • add in any derived (custom) fields
    • use the Record Relationships to get the data that the View currently provides and (if possible - if it's not being used elsewhere) deprecate your View