Forum Discussion

arvindnsn's avatar
arvindnsn
Contributor
7 years ago
Solved

How to create multiple hierarchy sets in for API output

Hello, I am having issues structuring the API output i am working in. I have attached both the Source data and the JSON output structure expected in the attachment. I have attached the source file ...
  • koryknick's avatar
    4 years ago

    It’s the newline character in the string that is causing the issue. The dot notation for character matching in regex does not match newlines. After a bit of thought, we can also simplify the result by using the regex group capture syntax. Try this:

    $notes.replaceAll('\n','').replace(/.*#IF:(.{9}).*/g, '$1')