AnsweredAssumed Answered

parsing, counting comma delimited characters in a field

Question asked by poliver88 on Oct 17, 2018
Latest reply on Oct 25, 2018 by fmpdude

I have a little bit tricky (for me) question.


In my solution i need to parse data from two JSON files into a one field.


JSON1 can look like this

example:

505,506,507

or

503,234

or

404,304,340,254

etc.

 

JSON2 is a bigger file that contains the labels for all the keys
example

{
     label: "LABEL_NAME",
     value: 505
}
{
     label: "DIFFERENT_NAME",
     value: 506
 }
{
     label: "ANOTHER_LABEL",
     value: 507
 }

etc.

 

what I need to achieve is to turn the values from JSON1 into their corresponding labels before placing the values into a field
for example

 

turn

505,506,507

into

LABEL_NAME, DIFFERENT_NAME, ANOTHER_LABEL

 

I understand I need to either loop through JSON1 or JSON2 to achieve this.

 

What i'm struggling to wrap my head around is counting, delimiting the values from the JSON1 and using those in sequential loop runs.

 

Any tips greatly appreciated!

Outcomes