Skip to main content
sivakrishnam0002
March 21, 2024
Question

How to delete rows from arrays of arrays (Nested CDTs)?

  • March 21, 2024
  • 7 replies
  • 0 views

Hello All, I have a requirement where we need to delete rows based on array's of arrays(nested arrays) when i tried to implement the logic and try to delete the rows i'm getting the below error message as shown.

Can you please let me know what could be the best solution or approach  to achieve this requirement.

CDT structure:

Delete code:

Error screenshot:

7 replies

stefanhelzle0001
Brainy
March 21, 2024

The error message tries to tell you that CTRIS_Part1_Sponsor_ThirdPartyOrg does not have a field called thirdPartyOrgDetails.

sivakrishnam0002
March 22, 2024

Please find the below screenshot for better understanding on how we are using arrays of arrays.

{
'type!{urn:com:appian:types:CTRIS}CTRIS_Part1_SponsorDetails'(
'ctrisId': 1473,
'sponsorName': "GSK R&D Ltd",
'organizationType': "Commercial",
'thirdPartyOrgDetails': {
'type!{urn:com:appian:types:CTRIS}CTRIS_Part1_Sponsor_ThirdPartyOrg'(
'ctrisId': 1473,
'orgId': "Test Organisation ID",
'orgName': "Test Name of organisation",
'duties': "Statistical Analysis,Q/A auditing",
'tpAddress': 'type!{urn:com:appian:types:CTRIS}CTRIS_AddressDetails'(
'ctrisId': 1473,
'context': "Third Party Organisations associated with the trial",
'addressLine1': "Address: Street name",
'country': "USA",
'phone': "1234567",
'email': "test@gsk.com"
),
),
'type!{urn:com:appian:types:CTRIS}CTRIS_Part1_Sponsor_ThirdPartyOrg'(
'ctrisId': 1473,
'orgId': "Test Organisation ID 2",
'orgName': "Test Name of organisation 2",
'duties': "Safety reporting,E-Data capture",
'tpAddress': 'type!{urn:com:appian:types:CTRIS}CTRIS_AddressDetails'(
'ctrisId': 1473,
'context': "Third Party Organisations associated with the trial",
'addressLine1': "Address: Street name 2",
'city': "Town/City 2",
'postalCode': "12345",
'country': "India",
'phone': "12345"
)
)
},
'orgSPORId': "ORG-100005535"
)
}

Based on the above code snippet, I need to delete the above highlighted rows.

currently I'm using the below code to delete which is erroring out. Could you please provide me the proper code to achieve this requirement. 

davidj137213
Brainy
March 27, 2024

Could you post the for each part of your code please? Maybe you are iterating over the main array, but referencing the child one?