An overview of what we are after:
- Why is the template formula sometimes appearing in the generated document?
- How do we display images if one row does not have any images whilst still displaying the rows which do?
The issue we are having:
We want to generate a document for inspections carried out against a job. A document needs to be generated for each job - it should list all the inspections against that job.
We get the job and inspection info from SQL using a flow. We get the images against each inspection using SharePoint also within the flow.
We then construct some JSON ready to be sent to Plumsail which contains all of the relevant job info, inspection info and the image base64 which is retrieved from SharePoint.
For the collection of inspections, there are sometimes some inspections without images. The issue is, trying to display both the inspections WITH images and the ones WITHOUT.
See the below image for the formulas attempted in our template document
Here, we have the 'master' table which displays the inspections - {{SiteInspections}} array. For an inspection, we also have a textbox seen in image which also has a table in it - this is used to handle the orientation of the images.
Here we display {{SiteInspections.SiteNoteImages}}, which should display an array of images for that inspection.
One instance of the issue is that when an inspection without images is inserted, the template formula, :hide-block-if-empty will hide the inspection row. The :hide-block-if-empty block has been removed from the document attached for our troubleshooting. We only want to hide the images table (within the textbox) should there not be any images. So, for an inspection without images, we still want to see the inspection row, but just with no images.
FYI, the textbox for the images was used to handle the orientation of the images.
FYI, in the case that we DO have images for each inspection, the document is generated correctly - see this example:
all inspections WITH images.docs
Sometimes we have the case where the formula is displayed in the generated document but only for SOME inspection rows - very strange.
Here is the attached template document with the template formulas we are using:
template document used.docx
Here is an overview of the flow steps:
Above, is an overview of the flow steps we are using.
We want to collect inspections for a particular job. Then, for each of those inspections, we want all the images captured (which are stored in SharePoint).
The final JSON step you can see is the one sent to Plumsail.
I understand this may be a lot of information but we will hopefully be able to collaborate to reach the solution.
Thanks
502408 json.txt (1.9 MB) all inspection WITH images.docx (88.6 KB) template document used.docx (147.7 KB)