Can I use a field value as an Attachment Template name

I want the user to select from a list of documents and then send the selected document as an email. Do I need to specifically create a new Workflow rule for each document or can I save the Docid in a field in my table and then use that variable name in the workflow rule?

If you want to use different templates depending on user’s choice, you need to create either one Workflow rule for each of them or you can create action for each template. Then only one Workflow rule is needed.

1 Like

To be specific here, I have a list of about 25 Word Documents that I need to work with. When the user adds a new job I need to give him the ability to choose which Word documents to print. Each of the documents will need some minor variable substitution (Name of author, project, etc) and then each of the selected documents need to be sent to a nominated email address.

What I had in mind was to use an ENUMLIST variable where the user can select the required documents. But how would I then generate and email the selected documents? However I am not sure how I could create an Action that would activate only the selected actions i.e. only send the selected documents.

Or is this approach not going to work and I need to create a related table and have the user add a new record for every Word document they want to generate and then send those emails as they add each record? Doing it that way would be much more cumbersome

If the difference between these templates is small… you could use one template but with different values. If the template structure is different like you have a big table in one template but very small or not at all in another one, that could be cumbersome as well. It would be interesting to see two templates where the difference is the biggest. Are you able to take a printscreen from those or either send them to aleksi@appsheet.com.

1 Like

Hi Aleksi,

The documents are Job safety analyses (JSA’s). Each one is substantially different and can be very long. E.g. the one I am working with now is 15 pages long. Others may be longer or shorter depending on complexity of the task.

Although each one is different the only changes they need are a few field substitutions on a table on the first page (copy attached), which is a summary of the Job being analysed. The fields that need entering are: <<[JSA Supervisor]>> <<[JSA Supervisor Mobile ]>> <<[Who For]>> <<[Job Title]>> <<[JSA Start]>> <<[JSA End]>> <<[Where]>> <<[Area Of Site]>>

What I need is to be able to select one or more of these documents, do the substitutions and email them to a nominated email address.

We have not supported this use case where the Attachment Template itself is a variable. Part of the reason we haven’t is because the templates need to be checked/verified for correctness at compile time. So an arbitrary file name specified dynamically may lead to incorrect or inconsistent behavior.

That said, your use case is certainly valid. A really convoluted way of doing this in our system today (I wish it were easier) is what Aleksi suggested — have a single workflow rule with 25 different email actions. But you put in some conditional check say in the email recipient list, so that only some get fired and the rest do not. As I said, very convoluted unfortunately.

1 Like

@prithpal fyi

Thanks Praveen and Aleksi.I will see if I can work out a conditional check and see it that’s less convoluted than adding a new record to a related table for each JSA required and have it fire every time one is added.

@Griff Please send those two different templates to my email and I will check them quickly. I have created one customer solution and one template is covering all situations. Just want to see those files if that could be possible as well.

1 Like