I use a bot to create a PDF file of the table "Budgets".
The PDF shows all items of the "Labor" column in one line (see next image).
Is it possible to have one item of labor per line as shown below?
This is the "Budgets" form.
This is from where I select the "Labor" items.
The column "Labor" is a Enum List.
Here is the "Budgets" table.
Any idea will be welcome.
Solved! Go to Solution.
One way you could try is to create a VC with an expression like
SUBSTITUTE([Labor], ", ", "
")
and print this VC. (note the space and carriage return in the expression).
Using the SUBSTITUTE formula directly in the template does not seem to do the trick...
Thank you for your response @TeeSee1.
I tried it, but it only replaces the comma with a space. This is what I get when testing the VC.
And this is the PDF.
Does AppSheet has a escape sequence for a carriage return in order to write it into a formula?
An alternative to try with no guarantee it will work:
SUBSTITUTE([Labor], ",", CONCATENATE("
"))
Is the VC's sole existence to test the functionality of what I proposed, or do you have a need for the VC regardless? If you have the VC regardless, then in your template have you tried just placing the VC column rather than the full expression? I have had luck with using line breaks in VCs and then using the VC in my template and it actually observes the line breaks if they are present in the VC.
I use the VC in order to test, but if it works, I'll use it.
This is the VC.
This is the expression.
This is what I have in the template.
This is the result.
What do you recommend?
Interesting. I don't think that what I suggested actually observes the line break. Then again, where I have used this I actually use & for concatenate rather than the formula. In that case, I am wondering if you should change the expression some. Try the following directly in your template first, then switch it to the VC and try the VC in the template if it doesn't give the desired results.
SUBSTITUTE([Substitute Piezas], ",", & "
" &))
The Enum column that has the list of items is called [Piezas]. It's a non virtual column. The VC is called [Substitute Piezas] and has the formula "Substitute".
I replaced [Substitute Piezas] with [Piezas] but I get this error.
What am I missing?
Might have to try it this way:
SUBSTITUTE([Piezas], ",", "" & "
" & ""))
The formula is Ok.
Now I'm gonna try it.
In the last screenshot I had the column [Substitute Piezas] in the formula. The correct column is [Piezas].
This is the formula I'm using in the VC [Substitute Piezas].
It sends no value and the scripts can't create the PDF.
Is it possible to achieve what I'm looking for?
What do you mean the script can't create the PDF? Here is an example I did real quick. My use case is an EnumList column with subtype of REF. Using the following I was able to get the VC to display on separate line items inside the detail view. Then if you use <<[YourVC]>> in your template it should also observe the line breaks.
SUBSTITUTE([RefEnumListColumn][ColumnNamefromRefTable], " , ", "" & "
" & "")
I have other apps creating PDFs using a bot that triggers an apps script and the script creates the PDF, but this is not the case. Sorry for the confusion.
In my first post, I showed details of my EnumList colum (see below). I use a Base type = Text and a Valid if = Labor [Labor]
As you can see, it's different from the one that you describe, because your Base type is Ref.
I'm going to follow your instructions, and I'll let you know.
I'll have to take another look at my other project which is under a different google account. I know that I do not use substitute in that project for line breaks but I do take a virtual column that creates line breaks with concatenating using the &. However, the main difference might be that I use a HTML template and that is why it might observe the line breaks correctly. I tried a few ways of using an attachment PDF in an email to create line breaks without success.
It works for me..
I got it!
It was not working because the VC was a Text column type. I changed it to Long Text and voila..!
I could see in the last post of @TeeSee1 that the type of the VC was "Long Text". AppSheet was setting this column as a "Text" type column, so I changed it from "Text" to "Long Text" as shown below.
This is the expression.
And this is the PDF.
Thank you very much @Markus_Malessa and @TeeSee1. I appreciate your time and effort.
User | Count |
---|---|
37 | |
31 | |
29 | |
22 | |
18 |