Power Automate flow crashes with filters in Word template

Hi! I am trying to get a table with a certain amount of rows, depending whether I have or not data in a Sharepoint List. When I leave all the data in the Word Template (with the empty rows for the empty fields), it works perfectly. But, when I try to make a filter of "empty rows" (or any filter at all), the Power Automate flow would need to be cancelled cause it gets stuck forever in that task...

Here is my filter in word:
{{nonEmpty = table|filter(value.row =! "")}}

image

I also tried this as in the example and it also hangs:
{{nonEmpty = table|filter(value.row == "development")}}

And here is my json:

{
"table": [
{
"characteristic": "Colour and appearance:\t",
"row": "Esta es una prueba"
},
{
"characteristic": "Specific weight (20°C):",
"row": "Specific weight (20°C):\t1,10 ± 0,02 g/cm³"
},
{
"characteristic": "pH (20°C):",
"row": "3,0 ± 0,5"
},
{
"characteristic": "",
"row": ""
}
]
},

Hi @Leandro,

I tested the filter formatter and it worked for me. This is my setup:

  1. The DOCX template

template-test-filter.docx (13.6 KB)

  1. The flow

  1. The flow is successful and the result:

  1. I used the JSON.
{
    "table": [
        {
            "characteristic": "Colour and appearance:\t",
            "row": "Esta es una prueba"
        },
        {
            "characteristic": "Specific weight (20°C):",
            "row": "Specific weight (20°C):\t1,10 ± 0,02 g/cm³"
        },
        {
            "characteristic": "pH (20°C):",
            "row": "3,0 ± 0,5"
        },
        {
            "characteristic": "",
            "row": ""
        }
    ]
}

Could you confirm that your flow hangs specifically on the Plumsail action and not on the SharePoint action or any other third party?

Please compare your flow and template with mine and try again.

Best regards,
Petr
Plumsail team

Dear Petr,

Thanks for your reply. Here are my findings:

  • The flow hangs on the Plumsail part, when it is supposed to generate a PDF template. When changed to DOCX, it works.

I also found that when adding the filter inside a text box, all the text box dissapears and no filter is done.. please take a look at this file. Any ideas on how to solve this to have inside of the text box both the text and then the filter? I mean, I have text that has to go "before" the table.

template-test-filter2.docx (26.5 KB)

Cheers,

Leandro

Hello @Leandro,

  1. You can place the filter condition outside the textbox and it will work.

  1. I changed my flow to save the output as PDF and it also worked

Please share screenshots with the Power Automate flow flow in Edit mode with all the errors.

Best regards,
Petr
Plumsail team

1 Like

Hi @Petr,

It works like a charm! Thanks for your support.

Leandro

1 Like