I am facing an issue with a flow where I am extracting clauses from a document. The extraction is successful, but the clauses are being replaced with commas (",") instead of being removed.
Here is my flow:
- When a file is created (properties only)
- Site Address: mysite
- Library Name: Documents
- Folder: /Shared Documents
- varFicheroProcesado
- Name: varClausulas
- Type: Boolean
- Value: false
- varClausulas
- Name: varClausulas
- Type: String
- Value: UNDÉCIMA.-;DÉCIMA.-;NOVENA.-;OCTAVA.-;SEPTIMA.-;SEXTA.-;QUINTA.-;CUARTA.-;TERCERA.-;SEGUNDA.-;PRIMERA.-;
- Get file Content
- Site Address: mysite
- File Identifier: triggerOutputs()?['body/{Identifier}']
- Condition TXT
- triggerOutputs()?['body/{FilenameWithExtension}'] - ends with - txt
- If Yes
- Run a child Flow
- Child Flow: SplitText
- contrato: triggerOutputs()?['body/Title']
- clave: Y para que asà conste se extiende;CLAUSULAS
ADICIONALES;CLAUSULAS;DECLARAN;COMUNICAN
- CLAUSULAS
- Child Flow: SplitText
- contrato: body('Get_file_content_2')
- clave: variables('varClausulas')
- CLAUSULAS ADICIONALES
- Child Flow: SplitText2
- contrato: body('Get_file_content_2')
- clave: variables('varClausulas')
- Create file TXT
- Site Address: mysite
- Folder Path: /Resultados
- File Name: triggerOutputs()?['body/{Name}']_contenido.txt
- File Content:
COMUNICAN last(outputs('Run_a_Child_Flow')?['Body']?['response'])
DECLARAN first(skip(outputs('Run_a_Child_Flow')?['Body']?['response'], 3))
CLAUSULAS reverse(outputs('CLAUSULAS')?['Body']?['response'])
CLAUSULAS ADICIONALES reverse(outputs('CLAUSULAS_ADICIONALES')?['Body']?['response'])
Y para que asà conste se extiende first(outputs('Run_a_Child_Flow')?['Body']?['response'])
- Move file TXT
- Current Site Address: mysite
- File to move: triggerOutputs()?['body/{Identifier}']
- Destination Site Address: mysite
- Destination Folder: /Procesado
- if another file is already there: Move with a new name
- Set varFicheroProcesado
- Name: varFicheroProcesado
- Value: true
- If no: vazio
- Condition PDF
- triggerOutputs()?['body/{FilenameWithExtension}'] - ends with - pdf
- If yes:
- Extract information from documents:
- AI model: Segundo_Bolque_Superior
- Form type: PDF Document
- Form: body('Get_file_content_2')
- Create file PDF
- Site Address: mysite
- Folder Path:/Resultados
- File Name:triggerOutputs()?['body/{Name}']_tabla.txt
- File Content: Here I have AI Models
- Move file PDF
- Current Site Address:mysite
- File to move:triggerOutputs()?['body/{Identifier}']
- Destination Site Address:mysite
- Destination Folder:/Procesado
- if another file is already there:Move with a new name
- Set varFicheroProcesado para PDF
- Name: varFicheroProcesado
- Value: true
- If no: vazio
- Condition 3
- variables('varFicheroProcesado') - is equal to - true
- If yes:
- Vazio
- If no:
- Move file PDF
- Current Site Address: mysite
- File to move: triggerOutputs()?['body/{Identifier}']
- Destination Site Address: mysite
- Destination Folder:/Error
- if another file is already there: Move with a new name
I am trying to remove the clause names such as "PRIMERA.-", "SEGUNDA.-", etc., from the extracted clauses. However, my attempts with the replace() function are not working as expected. Here is an example of the output I am getting:
[" "," Here is my contract text CONTRACT 2 \r\nHere is my contract text CONTRACT 2 y e Here is my contract text \r\nHere is my contract text CONTRACT 2 (de acuerdo con Here is my contract text \r\nen las empresas). \r\n"," Here is my contract text Here is my contract text Here is my contract text \r\ncHere is my contract text Here is my contract text. \r\n"," ... "," "," "]
Any help would be appreciated.