Hide arbitrary block

Hi,

I'm trying to get to grips with the above subject but cannot get it to work, even on a basic document I've created to test.
This is my template:
{{HouseName}}

Name {{Name}}

Medical. {{Med.Desc1}:hide-block-if-empty}

{{Med.RoomNo1}} – {{Med.Desc1}} {{Med.Desc1}:hide-block-if-empty}

{{Med.RoomNo2}} – {{Med.Desc2}}

{{Med.RoomNo3}} – {{Med.Desc3}}

Some text

If I test with JSON submission of:
{
"HouseName": "LG",
"Name": "D",
"Med.Desc1": null
}

I get a Docx file with the follwing in it:
LG

Name D

Medical. {{Med.Desc1}:hide-block-if-empty}

– {{Med.Desc1}:hide-block-if-empty}

I'm not sure what I'm missing here.
If Med.Desc1 is null I want to omit the lines Medical and -, but its also adding the {{Med.Desc1}:hide-block-if-empty}
Has anyone done this or something similar before?

Thanks for any info you can give.

D.

For an update, I've also tried the example here word for word and I get the same problem.
https://plumsail.com/docs/documents/v1.x/document-generation/docx/conditionally-hide-blocks.html?highlight=hide#hide-arbitrary-block

Is it broken or is the guide wrong?

Thanks.

D.

Hi @DKS77,

It seems that there is indeed an issue with the formatter. We'll check it and reply.

Best regards,
Petr
Plumsail team

This works as expected now. Thanks.

1 Like