Skip to main content
swapnar6405
Known Participant
Apr 11, 2023 7:33 PM UTC
Solved

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

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
)
}

Participating Frequently
Apr 12, 2023 6:24 AM UTC

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
Apr 11, 2023 9:06 PM UTC

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
sanchitg0002
Inspiring
Apr 12, 2023 2:33 AM UTC

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

Participating Frequently
Apr 12, 2023 6:24 AM UTC

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
    )
}