Removing duplicate records based on a column and condition on other column on CDT

Hi All,

I am new to Appian programming, and here I need your help; I have CDT, and based on the below screenshot, I need to remove the 5th record based on the following conditions.

The Person id duplicates, and ChildCustodialTypeId is NULL. In this scenario 5 the record I want to get rid of when I call the CDT, so please let me know how I could do this successfully.

  Discussion posts and replies are publicly visible

Parents
  • I think we need a lot more information about what you're trying to do. Are you trying to exclude the result from your query or are you trying to delete the row in your source table? Is this something you need to do through a process or just make the edit one time? Also, how did this data get in the table if it's in the wrong format?

  • Thank you, Peter, for your reply. Yes, I want to exclude it from the result.  The data got into the database during the data migration from the old system, which has been sitting there for a while. The only option for us is to exclude it from the result set. But I don't know how to write that code. So it would be nice if you could suggest to me a solution.

  • 0
    Appian Employee
    in reply to joseg199

    If this got into the database through a data migration, I'd suggest just deleting the row from the source (since it seems invalid). 

    As far as writing a query that could filter by this, I'm not sure there's a lot of great options. Just to clarify - is row 4 in your image above a valid row? If it's valid for the childCustodialTypeId to be null, then you may either need to write a stored procedure or just query the data and filter the results after it's returned. Curious if other practitioners have encountered a similar problem or have other ideas.

Reply
  • 0
    Appian Employee
    in reply to joseg199

    If this got into the database through a data migration, I'd suggest just deleting the row from the source (since it seems invalid). 

    As far as writing a query that could filter by this, I'm not sure there's a lot of great options. Just to clarify - is row 4 in your image above a valid row? If it's valid for the childCustodialTypeId to be null, then you may either need to write a stored procedure or just query the data and filter the results after it's returned. Curious if other practitioners have encountered a similar problem or have other ideas.

Children