Is there a textAlignment: “hangingIndent” but instead of shifting to the right, shifting to the left?

I know I can use something like this:

      "id": "hanging_indent_label",
      "anchor": "Here is the first line of a hanging indent",
      "method": {
        "id": "label",
        "position": "below",
        "textAlignment": "hangingIndent",
        "stop": "gap"

to get indented text like this:

image

but what if the text is outdented? Can I get text shifted to the left?

(cross posted from Slack by admin)

No*. Here are some alternatives, assuming you’re trying to grab some text below another line:

  • if you want multiple lines: use the Document Range method, which extracts any lines below the anchor line regardless of the alignment.

  • if you want just one line and you haven’t got a reliable match for defining a Stop for the Document Range method, you can use the Passthrough method. This would be a little complex – basically, you’d define an anchor array where the 1st match is your usual anchor, and the 2nd match is "type":"first" so that it grabs the 1st line below the anchor, regardless of horizontal alignment. Like this:

{
  "fields": [
    {
      "id": "test_field",
      "anchor": {
        "match": 
          [
            {
              "type": "includes",
              "text": "your anchor line",
            },
            {
              "type": "first",
            }                
          ]      
      },
      "method": {
        "id": "passthrough",
 
      }
    }
  ]
}

For example, anchoring on a phone number line in order to grab an email line that’s outdented to the left from the anchor’s perspective:

  • PS: There is a “textAlginment”:“left” option, but it doesn’t search for outdented text, it searches for text that aligns to the left boundary of the anchor line.