web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Issue with Removing Cl...
Power Automate
Unanswered

Issue with Removing Clause Names from Extracted Document

(0) ShareShare
ReportReport
Posted on by 71

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.
Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 283

#2
David_MA Profile Picture

David_MA 256 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard