Skip to main content
sivakrishnam0002
Known Participant
Mar 21, 2024 10:48 AM UTC
Question

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

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
Mar 21, 2024 11:51 AM UTC

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

sivakrishnam0002
Known Participant
Mar 22, 2024 10:06 AM UTC

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
Mar 27, 2024 12:07 PM UTC

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