Hi all, I'm getting a response from plugin something like below: 1

Hi all,
I'm getting a response from plugin something like below:
1;2;3;4;5
A;B;C;D;E
IL;NC;SC;TX;IN

There is no limit on how many rows and columns would come in this fashion.

I need to read the above data as {"1;A;IL","2;B;"NC","3;C;SC","4,D,TX","5,E;IN"}

Each of the above would be a case in our scenario.

How can I achieve this?

Any inputs are highly appreciated!!!!!!

OriginalPostID-213135

OriginalPostID-213135

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    I believe the solutions above are almost correct. Create a supporting rule (eg rule!myRule) that accepts three inputs, and that does:

    {
              ri!input1,
              ri!input2,
              ri!input3
    }

    Then do the following:

    apply(
              rule!myRule,
              merge(
                        {1,2,3,4,5},
                        {A,B,C,D,E},
                        {IL,NC,SC,TX,IN}
              )
    )

    Note that if you try to display the result of the apply() above, you'll see it as a flat array, as you've essentially returned an array of arrays and the expression editor can't display that any other way. To see only the first element, try wrapping the apply() in an index(<apply>,1,{}) - you should see {1,A,IL}.
Reply
  • 0
    Certified Lead Developer
    I believe the solutions above are almost correct. Create a supporting rule (eg rule!myRule) that accepts three inputs, and that does:

    {
              ri!input1,
              ri!input2,
              ri!input3
    }

    Then do the following:

    apply(
              rule!myRule,
              merge(
                        {1,2,3,4,5},
                        {A,B,C,D,E},
                        {IL,NC,SC,TX,IN}
              )
    )

    Note that if you try to display the result of the apply() above, you'll see it as a flat array, as you've essentially returned an array of arrays and the expression editor can't display that any other way. To see only the first element, try wrapping the apply() in an index(<apply>,1,{}) - you should see {1,A,IL}.
Children
No Data