delete the data from record

 Hello,

I'm a beginner, I have created a form and connected it to the data store and successfully writing the data to data store. Now in records I have many duplicates, I hate to delete them. How to do it? I've also come across using a  Delete from "Data Store Entities" but in my CDT I have an ID and primary key for it. But its never showcased under records. Thus how to delete a record now. 

Please refer to below screen shot

 

None of them are represented by an ID, but in Name hyperlink there is the Summary, though how can I delete the record. It should also be totally deleted from mysql DB.

Any suggestion would be highly appreciated...!!

  Discussion posts and replies are publicly visible

  • Hi Nellore,

    I would suggest that you review this topic in the documentation: Create a Feed-Style Record List

    Follow the link and then scroll down a bit to view this detail:

    You’ll notice that record values are called with the record field domain (rf!). Every field in your data source is available as a record field.

    Even though you're not displaying the Id, you should be able to reference it using rf!<yourIdFieldName>.

  • Hello Robert,

    Thank You, for the information. I have so many Record fields, so is there any method to delete them from the record?
  • Hi Nellore -

    For your record type, if you wish to ALWAYS exclude excess fields that exist in the original data store entity (database table) you can create a new "mini" CDT that contains only the fields you're interested in and map that as a new data store entity in Appian. Then base your record type on your mini-CDT.
    This won't delete the fields, but instead, Appian is basically ignoring the fields.
    If you want to keep the same database table, and remove the fields from the table for good, you'll have to do that manually in the database.
  • Hi,

    Not sure if I understood your requirement correctly, For the duplicates to not show up on the record, you can delete it from the mySQL DB right. Whichever table/entity is populating the record, that should have the primary keys, you can get that using a query entity and pass it into a process model to delete them via the Delete from data store entities.

    Thanks.
  • 0
    A Score Level 2
    in reply to nellorea0001

    Hi Nellore,

    May be I'm missing something here, What are the duplicates you are seeing in your database? Are they duplicate rows? or duplicate columns,

    1. Duplicate rows: How did they get inserted, when ever you are using the write to data store entity smart service make sure that you always passing the Id field(assuming Id field is the primary key in your table and is configured in your CDT) when you want to Update a row in the DB. Passing the Id field is not mandatory for inserting a new row into DB(assuming Id field is being generated by DB from a Sequence).

    2. Delete data From DB: If you want to delete the data from DB you can use Delete from Data Store Entities smart service.

    this Smart service will accept entity and identifiers

    ={entity:<Entity Name>, identifiers:<your primary key>}

    eg: {entity:pv!AMS_TASKS,identifiers:pv!taskDetails.taskID} where pv!AMS_Tasks is of type data store entity and pv!taskDetails is of type task CDT and taskId is the primary key in that CDT.

    I will not recommend Hard delete from DB instead we can go with Active Indicator approach. This can be done in Project.

    For record fields to display only selected columns, open your grid style record list, click on the columns, you can see all the columns that are displayed in your record and you can simply click on "X" to remove that column being displayed in the Grid.

  • Are you sure you want to delete the data? Generally I find it is better to have a boolean column for "active/inactive". Instead of deleting, update the row to have false for active. Then make sure to only query on active rows. Hard deletes can be dangerous, once the data is gone it may be gone forever depending on how often you backup your DB and what your logging settings are.

  • Hi nellorea,

    Can you please elaborate your requirement in detail? I didn't get the exact scenario you are talking about because you are saying that duplicates in records and ID is primary key in CDT. If the ID is a primary key then there is no chance of duplicates right.
    Please confirm that it is duplicate rows or duplicate columns in records?
  • The best option now would be to go directly to the database and delete the duplicates. Then, design your CDT's with the primary keys to avoid duplicates again. If the primary keys are set properly you should be fine from now.
    Yeswanth.
  • 0
    Certified Lead Developer
    Hi,

    You could create a view which holds the distinct value and create your record using that view.

    Thanks,
    Nitesh