Skip to main content
swapnar6405
April 11, 2023
Solved

How to pass multiple rows of data to CDT during interface testing

  • April 11, 2023
  • 3 replies
  • 0 views

Hi,

I am using CDT "AM_Business" in one of the interface. I may get an array of values.

Now, I would like to test the interface by passing multiple rows of data.

I was able to test with single row of data, but not sure the format for passing multiple rows of data.

Can any one help here.

{
'type!{urn:com:appian:types:AM}AM_Business'(
'businesskey': 148,
'headerkey': 95,
'dbkey': 3
)
}

Best answer by shuaibs6722

I think "Mike" has already suggested the correct way, to simplify you can do it by following the simple steps:

1- Make sure the rule input for the CDT accepts is an array (Select it as Multiple)

2- Pass an array of manual entries in the testing pane as follows 

{
    'type!{urn:com:appian:types:AM}AM_Business'(
    'businesskey': 148,
    'headerkey': 95,
    'dbkey': 3
    ),
    'type!{urn:com:appian:types:AM}AM_Business'(
    'businesskey': 149,
    'headerkey': 96,
    'dbkey': 4
    ),
    'type!{urn:com:appian:types:AM}AM_Business'(
    'businesskey': 150,
    'headerkey': 97,
    'dbkey': 5
    )
}

3 replies

mikes0011
Brainy
April 11, 2023

Assuming that the rule input is of the correct CDT type and "multiple", you should be able to manually enter multiple entries in the testing input inside curly brackets (similar to what you already have here), with additional entries inside the curly brackets and separated from each other with a comma.

The Expression Guru
April 12, 2023

If there are entries in your DB table then you can also use query rule to get the required data all at once.

April 12, 2023

I think "Mike" has already suggested the correct way, to simplify you can do it by following the simple steps:

1- Make sure the rule input for the CDT accepts is an array (Select it as Multiple)

2- Pass an array of manual entries in the testing pane as follows 

{
    'type!{urn:com:appian:types:AM}AM_Business'(
    'businesskey': 148,
    'headerkey': 95,
    'dbkey': 3
    ),
    'type!{urn:com:appian:types:AM}AM_Business'(
    'businesskey': 149,
    'headerkey': 96,
    'dbkey': 4
    ),
    'type!{urn:com:appian:types:AM}AM_Business'(
    'businesskey': 150,
    'headerkey': 97,
    'dbkey': 5
    )
}