Reading doc type field

I am integration Jira tasks into Coda. Description field in Jira is represented in coda as doc type, so in a column i can only see “doc” and when i hover over it I can explore further via doc.paragraph where I see the actual value. How can I access doc.paragraph using formula?

Hi @Michael_Igor_Popov,
Can you take a look at -

If that does not help please share your doc with support@coda.io and I can help you get this extracted.

Hi, thanks for the link.
Unfortunately Jira description is a bit more complicated and i could not work out how to parse its JSON and .filter doesn’t seem to be working. I managed to extract the json below and I also shared the document
I need to collect all “text” values

  • “type” : doc,
  • “content” : -{
    • “type” : arr,
    • “value” : -[
      • -{
        • “type” : obj,
        • “value” : -{
          • “type” : paragraph,
          • “content” : -{
            • “type” : arr,
            • “value” : -[
              • -{
                • “type” : obj,
                • “value” : -{
                  • “text” : We need to choose a page builder for our wordpress website,
                  • “type” : text}},
              • -{
                • “type” : obj,
                • “value” : -{
                  • “type” : hardBreak}},
              • -{
                • “type” : obj,
                • “value” : -{
                  • “text” : Requirements:,
                  • “type” : text}}]}}},
      • -{
        • “type” : obj,
        • “value” : -{
          • “type” : orderedList,
          • “content” : -{
            • “type” : arr,
            • “value” : -[
              • -{
                • “type” : obj,
                • “value” : -{
                  • “type” : listItem,
                  • “content” : -{
                    • “type” : arr,
                    • “value” : -[
                      • -{
                        • “type” : obj,
                        • “value” : -{
                          • “type” : paragraph,
                          • “content” : -{
                            • “type” : arr,
                            • “value” : -[
                              • -{
                                • “type” : obj,
                                • “value” : -{
                                  • “text” : Lightweight - top priority,
                                  • “type” : text}}]}}}]}}},
1 Like

I’m no Coda support, but I know regular expressions :slight_smile:

Please share with me either a doc (with actinarium@gmail.com) or paste here the raw sample JSON that you’re getting, unformatted: wrap in three accents before and after:
```
your code
```

Maybe I’ll be able to help parse this quickly with regex.

@Michael_Igor_Popov @mallika

P.S. Actually I just went ahead and wrote a regex/formula that should extract all occurrences of values for the key text anywhere in a valid JSON (unescaping values as a small bonus, no \n support though but that’s trivial to add if needed):

thisRow.[My JSON].RegexExtract('(?<="text"\ *:\ *")(?:\\"|[^"])*', "g").FormulaMap(
  CurrentValue.RegexReplace('\\(.)', '$1')
).Join("
")

(Uses experimental hidden formula RegexExtract which, when used with g modifier, returns a list of matched strings. If using a hidden formula is a problem, this could be rewritten with just RegexReplace though)

Thank you, @Paul_Danyliuk . I was always fascinated with the people who know regular expressions :slight_smile: