Lines: Enrich sub-description

action_lines_enrich · action · Utility · Available · v1.0.0

Description

Add the "sub-description" (the second line below the article code in the PDF) to each order line ONLY when the code matches a configured rule. Excludes generic notes like "On balance Vs. order". Output: same lines with enriched product_description.

⚙️ Configuration parameters

Fields shown in the editor when configuring the node. Generated directly from the NodeDefconfigFields.

FieldTypeRequiredDefaultDescription
linesExpression
Righe sorgente
expressionno
{{$node.extract_of.json.lines}}
Espressione che ritorna l'array lines[] da arricchire. Se vuoto, usa l'input del nodo precedente. Ogni riga DEVE avere almeno product_code, product_description (gli altri campi sono passthrough).
rawTextExpression
Testo PDF grezzo
expressionyes
{{$node.pdf_extract.json.text}}
Espressione che ritorna il testo grezzo del PDF (output di pdf_extract). Serve per cercare le sotto-righe indentate sotto a ogni codice.
includeCodePatterns
Codici che RICHIEDONO sotto-descrizione (uno per riga)
stringno^\d{1,2}\/$ -BOB$ -7000$ -3510$ -1865$ -24DC$ -24AC$ -2400$Una regex per riga, applicata al product_code. Se il codice matcha UNA delle regex, la sotto-descrizione viene cercata e aggiunta a product_description. Default inclusi (Rotork-like): • ^\d{1,2}\/$ — codici generici tipo "27/", "8/" • -BOB$ — bobine senza voltage specifico (es. "RB206DBX-BOB") • -7000$, -3510$, -1865$, -24DC$, -24AC$, -2400$ — varianti voltage/sigla Aggiungi altri pattern del tuo dominio: es. "^OPZ-" per opzionali, "-CUSTOM$" per personalizzazioni.
excludePrefixes
Sotto-righe da IGNORARE (uno per riga)
stringnoA saldo Vs. ordine In acc. Vs. ordine Vostro riferimento Nostro riferimentoPrefissi case-insensitive: se la sotto-riga inizia con uno di questi, viene IGNORATA (non aggiunta a product_description). Tipico: note amministrative, riferimenti commerciali, marker di pagamento.
separator
Separatore tra descrizione e sotto-descrizione
stringnoStringa inserita tra descrizione e sotto-descrizione quando entrambe sono presenti. Default " — " (em dash). Altre opzioni: " · " (interpunct), "\n" (newline, per wrap cella Excel), " | " (pipe).

⬆️ Node output

Fields available to downstream nodes via $node.<alias>.json.<field>:

  • lines
  • enrichedCount

💡 Configuration example

JSON snippet of the node as it appears in the workflow. Values are derived fromdefaultValue and from required parameters.

{
  "id": "node-action_lines_enrich-1",
  "defId": "action_lines_enrich",
  "label": "Lines: Enrich sub-description",
  "config": {
    "rawTextExpression": "{{$node.pdf_extract.json.text}}",
    "includeCodePatterns": "^\\d{1,2}\\/$\n-BOB$\n-7000$\n-3510$\n-1865$\n-24DC$\n-24AC$\n-2400$",
    "excludePrefixes": "A saldo Vs. ordine\nIn acc. Vs. ordine\nVostro riferimento\nNostro riferimento",
    "separator": " — "
  }
}

🔗 Related nodes in the same category

Ready to use Lines: Enrich sub-description?

Available now on all FlowForge plans. Try it free without a credit card.

Start freeBrowse all nodes