Hide empty text field in PDF

Hi, is there a way to not show empty columns when generating PDF through workflow? E.g. I have around 20 columns and users only fill up 10. Is there a way to hide the unfilled columns as the PDF will show a lot of blank pages when PDF is generated.

0 17 2,391
17 REPLIES 17

Yes you can do that with a combination of If & EndIf expression. Check this articleโ€ฆ

Thanks for the tip! Will try it out.

Youโ€™re welcome

Hi Aleksi, I have recently tried the <if:> and <> unfortunately itโ€™s not working. I have tested this code <<If: ISNOTBLANK([Accommodation Drawing 11])>><<[Accommodation Drawing 11]>><> the table row still appear even though the content is blank. Appreciate if you could advice if Iโ€™m missing anything. Would like to highlight that Iโ€™m doing it by table row to show the data.

I can investigate if you provide:

  1. Your account id
  2. The app name
  3. The rule name
  4. The exact steps to reproduce the problem

Hi Phil,

Thank you so much for your assistance. To summarize, the app Iโ€™m trying to create is a investigation app for vessel. Each time when someone goes to a vessel they will need to take photos and report state the conditions of these things. The report can generate 6 different reports base on location of the vessel.

  1. 848229
  2. POSH reporting Beta 1.4
  3. On Change in Accommodation
  4. I have roughly around 50 columns in the word file and it consist Drawing and Text in each column. E.g Drawing 1, comment 1, Drawing 2, comment 2, and so forth. If users only fill up until 20 pictures, they will see extra blank pages after the PDF is generated

@Phil Isnโ€™t this the same user case we discussed yesterday? When you use the expression If: EndIf in a table row and the evaluation is false, it wonโ€™t delete that row from that table.

You have a solution for this problem (evaluation is false, it wonโ€™t delete that row from that table.) I want to hide the empty rows (columns) from my table for improve the design of final report.

Hi Aleksi,

You are probably right Aleksi. I am unclear about what her template looks like and what she is trying to achieve.

Here is a brief explanation of how << If >> expressions are intended to work.

Given the following template:

<<Start: >>
<<If: ISNOTBLANK([Drawing 1])>><<[Drawing 1]>><< EndIf >>
<<If: ISNOTBLANK([Drawing 2])>><<[Drawing 2]>><< EndIf >>
<<If: ISNOTBLANK([Drawing 3])>><<[Drawing 3]>><< EndIf >>

<< End >>

For each record returned by the Start expression, the template will list the drawings that are not blank. For example, if โ€œDrawing 1โ€ is present and โ€œDrawing 2โ€ and โ€œDrawing 3โ€ are blank, then only โ€œDrawing 1โ€ is displayed, along with the blank line following โ€œDrawing 3โ€.

If all three drawings are blank, you will still get the blank line at the end of the template.

If you only want to list a row if at least one drawing is present, you should exclude any rows with no drawings in the Start expression.

When you use << If >> expressions like the ones above, we do not have logic to detect that all three drawings are absent and that we should omit the row entirely. I am not sure doing that is even desirable. It is very complex to implement and it requires that we guess about the intent of the template creator. In the case above, there is simply a blank line at the bottom. You could argue that we should ignore blank lines. What should we do if the template contains other formatting elements, like thin lines between the images? Should we ignore those also? I am concerned that adding a bunch of inference rules about what parts of the template to ignore will make the feature too hard to understand.

The Start expression already provides a way to control which rows are listed. The Start expression can refer to a Slice. Slices provide a good place to specify and test the row inclusion expression. That seems like the best way include or exclude entire rows from the result.

A template like the following worked for me:

Accommodation Key: <<[Key] >>
Vessel Name: <<[Vessel Name] >>
Date Report: <<[Date Report] >>
<< If: OR(ISNOTBLANK([Accommodation 1]), ISNOTBLANK([Accommodation Drawing 1])) >>
Accommodation 1: <<[Accommodation 1]>>
Accommodation Drawing 1: <<[Accommodation Drawing 1]>>
<< EndIf >>
<< If: OR(ISNOTBLANK([Accommodation 2]), ISNOTBLANK([Accommodation Drawing 2])) >>
Accommodation 2: <<[Accommodation 2]>>
Accommodation Drawing 2: <<[Accommodation Drawing 2]>>
<< EndIf >>
<< If: OR(ISNOTBLANK([Accommodation 3]), ISNOTBLANK([Accommodation Drawing 3])) >>
Accommodation 3: <<[Accommodation 3]>>
Accommodation Drawing 3: <<[Accommodation Drawing 3]>>
<< EndIf >>
<< If: OR(ISNOTBLANK([Accommodation 4]), ISNOTBLANK([Accommodation Drawing 4]))>>
Accommodation 4: <<[Accommodation 4]>>
Accommodation Drawing 4: <<[Accommodation Drawing 4]>>
<< EndIf >>
<< If: OR(ISNOTBLANK([Accommodation 5]), ISNOTBLANK([Accommodation Drawing 5])) >>
Accommodation 5: <<[Accommodation 5]>>
Accommodation Drawing 5: <<[Accommodation Drawing 5] >>
<< EndIf >>

Although this template works, my recommendation would be to change the way the Accommodation drawing information is stored.
Having a repeating field with from zero to fifty occurrences is seldom the best approach for storing repeating data.
This is especially true, when the number of instances varies and can be large.

It would be better to create a new child table to hold the Accommodation data.
Each row in the table would contain one drawing.

The child table would contain:

  1. A key Text field with the InitialValue of UNIQUEID()
  2. A Ref field that refers to the parent table
  3. An โ€œAccommodationโ€ Text field.
  4. A โ€œDrawingโ€ Drawing field.

Your template would then include a Start expression that used the Reverse Ref in the parent record to list each of the child table records.

Thanks so much for the advice. I tried to create a child table before but I was having problem generating reports just for Accommodation report from the parent table. The report only generated 1 Accommodation text field and Drawing field. I will try out again, I may have left out adding expressions in it and that might the reason why it was not working.
Once again thank you so much for taking your time to explain all these details to me. Really appreciate it. Cheers!

I think you will find that the child table will make your life easier.

Do the following:

  1. Add the child table to hold the photos, as I described above.
  2. Create the workflow attachment or body template for the parent record by clicking the โ€œCreateโ€ button. AppSheet should automatically generate a template that will list the parent and child records. It knows to include the child records in the generated template because the parent record contains a system generated Reverse Ref field to the child records. The generated template will contain a Start expression that retrieves the child records using the Reverse Ref field.
  3. You my want to modify the generated template to improve its appearance.

If you have trouble with the template, let me know, and I can help you.

Are you able to show a printscreen what you are looking for?

Hola, he intentado de varias formas evitar que se muestren renglones vacios en el PDF y no lo he logrado, como lo he utilizado es:

<<START: SELECT(pRUEBA[CLAVE TALLER],TRUE)>>

<<IFS( ISNOTBLANK([BANCO DE ENDEREZADO O MINIBANCO (MENOS DE 70 RPM)]),[BANCO DE ENDEREZADO O MINIBANCO (MENOS DE 70 RPM)]&โ€œ

โ€œ)>>

<<IFS( ISNOTBLANK([SISTEMA DE MEDICIร“N ELECTRร“NICO/ MANUAL (MENOS DE 94 RPM)]),[SISTEMA DE MEDICIร“N ELECTRร“NICO/ MANUAL (MENOS DE 94 RPM)]&โ€œ

โ€)>>

<<IFS( ISNOTBLANK([EQUIPO DE SOLDADURA POR PUNTOS DE RESISTENCIA (PUNTEADORA)]),[EQUIPO DE SOLDADURA POR PUNTOS DE RESISTENCIA (PUNTEADORA)]&โ€œ

โ€)>>

<<IFS( ISNOTBLANK([EQUIPO DE SOLDADURA DE MICRO ALAMBRE (MIG / MAG)]),[EQUIPO DE SOLDADURA DE MICRO ALAMBRE (MIG / MAG)]&โ€œ

โ€)>>

<<IFS( ISNOTBLANK([SPOTTER ELร‰CTRICO]),[SPOTTER ELร‰CTRICO]&โ€œ

โ€)>>

<<END>>

y tambien:

<<START:[Related Areas de Oportunidad]>>

<<IF: ISNOTBLANK([BANCO DE ENDEREZADO O MINIBANCO (MENOS DE 70 RPM)])>><<[BANCO DE ENDEREZADO O MINIBANCO (MENOS DE 70 RPM)]&โ€

โ€œ>><<ENDIF>><<IF: ISNOTBLANK([SISTEMA DE MEDICIร“N ELECTRร“NICO/ MANUAL (MENOS DE 94 RPM)])>><<[SISTEMA DE MEDICIร“N ELECTRร“NICO/ MANUAL (MENOS DE 94 RPM)]&โ€

โ€œ>><<ENDIF>><<IF: ISNOTBLANK([EQUIPO DE SOLDADURA POR PUNTOS DE RESISTENCIA (PUNTEADORA)])<<>>[EQUIPO DE SOLDADURA POR PUNTOS DE RESISTENCIA (PUNTEADORA)]&โ€

โ€œ>><<ENDIF>><<IF: ISNOTBLANK([EQUIPO DE SOLDADURA DE MICRO ALAMBRE (MIG / MAG)])>><<[EQUIPO DE SOLDADURA DE MICRO ALAMBRE (MIG / MAG)]&โ€œ

โ€œ>><<ENDIF>><<IF: ISNOTBLANK([SPOTTER ELร‰CTRICO])>><<[SPOTTER ELร‰CTRICO]&โ€œ

โ€>><<ENDIF>>

<<END>>

alguien ya lo logrรณ solucionar o que me apoye al respecto.
Mil gracias

Buen dรญa Rolando, ยฟLograste hacerlo? Esto ya me tiene frustrado... ๐Ÿ˜ช

Cada plantilla tiene sus propios desafรญos, te sugiero postear tu problema en particular incluyendo capturas de pantalla en un hilo aparte

Top Labels in this Space