Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Conditionally show/hide images in table

New Here ,
Sep 05, 2022 Sep 05, 2022

Goal 

I have a Word template that I'm populating dynamically with the document merge API. 

The goal will be to show images in a table column only if the correspondent element in the array (in the JSON) has the image property. The table is generated programmatically.

 

What I tried

  • I've tried adding a condition in the column cell, but it is rendered as plain text. For my understanding, conditions, in dynamically generated tables are not supported 😤
  • As a workaround, when the element has no image, I link it to a 1px transparent png to prevent the placeholder from showing up. This does the trick. The problem is that the placeholder's size is retained; hence the row doesn't shrink. Is there a way to resize the image programmatically?

 

I'm probably missing something. It seems absurd there's no solution for this. Can anyone help?

 

Thanks 

TOPICS
Document Generation API , REST APIs
157
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources