Add new entity to the database using only Record Type name

Hi all.

We would like to implement adding new entities to the database using only the Record Type name.

As far as I understand, to add a new entity, we need to know the name of the Data Store and the associated table (Data Type).

I have found general information about the Data Type in AppianSDK using TypeService, but there is no information about Data Type association with Data Store and Record Types.

Can I use AppianSDK to:

  1. Get the Record Type and information about the associated Data Type and Data Store
  2. Add a new entity to the database knowing Data Type and Data Store

Appian version 17.1

Thanks.

  Discussion posts and replies are publicly visible

Parents
  • Hello Andrew,
    I don’t know exactly what you are trying to achieve, but I have some comments in your question.

    Since the record type is not only associated to a data store entity, i don’t see why we should be able to retrieve some metadata information for the record in such way. For example what if the record is an expression retriving data from a Rest service?

    Other thing there is the need of a constant to use the smart service “write to database”. If you intend to do some reflection for example to introspect the records and insert to the table, doesn’t sound to me like something easy to do.

    But one option to achieve this can be for example create a rule which gives you the constant given a record or a record name, you can build a “map like rule”. (Decision table in later versions).

    Or mostly not recommended you can run a procedure to insert that, but in that case you will be skipping all the good functionality from appian.

    With all this said, If you are intending to use it inside of a plugin, well you can use a naming convention which can give you the name of the table and the data store and then you can retrieve all the objects required to insert in the table.

    It is interesting why you are trying to do this kind of stuff. Can you share ?

    Best Regards
    Jose Perez
  • Thanks for the answer.
    The option with "map like rule" seems to be one of the solutions for us.

    We are faced with the task of automating the addition of a processed document with metadata from the third-party system to the Appian system.
    To display diferent types of metadata in our application there is a set of Record Types.
    To transfer data, we have created in our Appian-application web-api methods that accept Json-objects with information and write it to Appian.
    To load metadata, we have a set of web methods that wrap the writeToDataStoreEntity function with different const!DataStoreEntity.
    We would like to leave only one CreateRecord web-method which would take the name RecordType and metadata, and carry choise of DataStoreEntity to the plugin method.
    Therefore the question arose whether it is possible to somehow get DataStoreEntity by the name RecordType.
    The name RecordType we want to use, because this is the main entity in Tempo through which our information is displayed and which the user sees (unlike constants or web-methods).

    Thanks.
Reply
  • Thanks for the answer.
    The option with "map like rule" seems to be one of the solutions for us.

    We are faced with the task of automating the addition of a processed document with metadata from the third-party system to the Appian system.
    To display diferent types of metadata in our application there is a set of Record Types.
    To transfer data, we have created in our Appian-application web-api methods that accept Json-objects with information and write it to Appian.
    To load metadata, we have a set of web methods that wrap the writeToDataStoreEntity function with different const!DataStoreEntity.
    We would like to leave only one CreateRecord web-method which would take the name RecordType and metadata, and carry choise of DataStoreEntity to the plugin method.
    Therefore the question arose whether it is possible to somehow get DataStoreEntity by the name RecordType.
    The name RecordType we want to use, because this is the main entity in Tempo through which our information is displayed and which the user sees (unlike constants or web-methods).

    Thanks.
Children