Store a string array in a array pv variable in the process model in the correct format

Hi,

I have a rule which returns an array of strings in this format:

List of Text String: 4 items (The number of values can differ depending on the number of values present in the database for a particular request)

"60,70"

"60,70,72,74"

"72"

"70,72,74"

When i use the same rule in the process model to store in a pv(process variable) having multiple checked then i expect the following value for the pv:

60,70, 60,70,72,74, 72, 70,72,74

Instead i get the value which considers each value as a different input to an array. Like this:

60, 70, 60, 70, 72, 74, 72, 70, 72, 74

Can anybody help me out with this?

  Discussion posts and replies are publicly visible

Parents
  • Hi,

    Try passing like - touniformstring(ri!textArrayInput).

    Can you share the code?
  • I already tried that. That doesn't work.

    This is the code:

    load(
    local!sDetails: rule!dcPcrFetchSDetails(
    ri!requestId
    ),
    local!MDetails: if(
    rule!Utils_CheckIsNull(
    local!sDetails
    ),
    null,
    if(
    rule!Utils_CheckIsNull(
    local!sDetails.Id
    ),
    null,
    rule!dcPcrFetchMDetails(
    filternulls(
    local!sDetails.id
    )
    )
    )
    ),
    a!forEach(
    items: index(
    local!sDetails,
    "id",
    {}
    ),
    expression: rule!dcPcrMTest(
    SId: fv!item,
    MSegDetails: local!MDetails
    )
    )
    )

    This is dcPcrMTest

    with(
    local!MData: index(
    ri!MSegDetails.mSegId,
    wherecontains(
    ri!SId,
    {
    ri!MSegDetails.sId
    }
    ),
    null()
    ),
    if(
    rule!Utils_CheckIsNull(
    local!MData
    ),
    "",
    joinarray(
    localMData,
    ","
    )
    )
    )
Reply
  • I already tried that. That doesn't work.

    This is the code:

    load(
    local!sDetails: rule!dcPcrFetchSDetails(
    ri!requestId
    ),
    local!MDetails: if(
    rule!Utils_CheckIsNull(
    local!sDetails
    ),
    null,
    if(
    rule!Utils_CheckIsNull(
    local!sDetails.Id
    ),
    null,
    rule!dcPcrFetchMDetails(
    filternulls(
    local!sDetails.id
    )
    )
    )
    ),
    a!forEach(
    items: index(
    local!sDetails,
    "id",
    {}
    ),
    expression: rule!dcPcrMTest(
    SId: fv!item,
    MSegDetails: local!MDetails
    )
    )
    )

    This is dcPcrMTest

    with(
    local!MData: index(
    ri!MSegDetails.mSegId,
    wherecontains(
    ri!SId,
    {
    ri!MSegDetails.sId
    }
    ),
    null()
    ),
    if(
    rule!Utils_CheckIsNull(
    local!MData
    ),
    "",
    joinarray(
    localMData,
    ","
    )
    )
    )
Children