Skip to main content
Participant
February 7, 2024
Answered

Conditional Table Rows with Images

  • February 7, 2024
  • 2 replies
  • 985 views

Hey Everyone,

 

I am looking for a bit of help here. I work for a company that is in the service industry. I have build a Power App that writes data into sharepoint for various service tasks. I have then created a flow that uses the document generator API to create the report. I have all of the data pulling through but am having an issue with tables that contain images and descriptions for the image but making the rows conditional based on whether or not there is any data to display.  I see there have been changes to the table side of the API and you now need to use Table Tags with markers. I have it building the table (all be it the conditional part is not working and deleting the lines) however the biggest issue is I can not work out how to insert the photos into the table. They are usually in the first column with the description in the second.  In the first column I have 

 

{% table-start MotorPhotoTable %}
{{MotorPhoto}}

with the second column being 

{{MotorPhotoDescription: discard-row-if(expr(MotorPhotoDescription = null))}}
{% table-end %}

 

The MotorPhoto is in Base64 and currently it is displaying it as that. If I insert an image input into the table to replace the MotorPhoto, it does not work. If i try and put the entire first lot into the image input, it does not work. 

 

Can anyone help out

 

Kind Regards,

Sam 

    This topic has been closed for replies.
    Correct answer Raymond Camden

    Would you mind sharing your Word doc and a JSON file so I can try locally? If it's private, you can email me at jedimaster@adobe.com.

    2 replies

    Participant
    February 14, 2024

    Hi Everyone,

     

    I would like to thank Raymond for his help on this. He has managed to help me get it going. 

     

    The first issue was that I was using the table name in the photo alt text as well as the photo name, which I did not need to do and secondly I had a space before the discard that I missed on multiple occasions

     

    Kind Regards,
    Sam Logan

    Raymond Camden
    Community Manager
    Community Manager
    February 7, 2024

    When you tested with base64, did you insert an image in Word itself?

    If you don't use base64, but rather HTML, does it work? If the image can be retrieved via URL of course.

     

    Participant
    February 7, 2024

    Hi Raymond,

     

    Thanks for your reply. I tried it with an image input as well as per the photo where the alt text for the image is in the code below it. I tried with and without the table name

     

    {
        "location-path": "MotorPhotoTable.MotorPhoto"
    }

    I havent tried HTML as an option yet as I was hoping to keep all of the image formats the same as their are other photos not inside tables that use Base64

     

    Kind Regards,

    Sam 

    Raymond Camden
    Community Manager
    Raymond CamdenCommunity ManagerCorrect answer
    Community Manager
    February 7, 2024

    Would you mind sharing your Word doc and a JSON file so I can try locally? If it's private, you can email me at jedimaster@adobe.com.