IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#40361 - 08/09/12 03:51 PM using local variable to name file attachment
Tracey Y Offline
OL Newbie

Registered: 02/02/12
Posts: 15
Loc: Ohio
I wanted to attach an existing PDF file in a folder to the Image email output of a PDF document created in design. The document gets emailed OK, but I can't seem to get the additional pdf file to attach.

I'm trying to use a local variable to choose the correct file name to attach from the folder. The syntax that I'm trying to use to get the named file is:

='C:\\REBATES\\'+trim(%{af_ToAddress})+'.pdf'

I know the local variable works. I'm really not a programmer and syntax is something I'm just guessing at here from other posts that I've seen. What am I missing?

Top
#40362 - 08/09/12 04:05 PM Re: using local variable to name file attachment [Re: Tracey Y]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
Tracey,

Workflow and Image don't work exactly the same way. What you wrote here would be how you'd write it in Design, but in Image's attachment tab, a different syntax is required.

All you'd have to write is:

C:\REBATES\%{af_ToAddress}.pdf

And then add it to the list of attachments. That should do the trick, you don't need double backslashes or + signs or anything.

Hope that helps!

Regards,
Raphaël Lalonde Lefebvre

Top
#40363 - 08/10/12 10:28 AM Re: using local variable to name file attachment [Re: Raphael Lalonde Lefebvre]
Tracey Y Offline
OL Newbie

Registered: 02/02/12
Posts: 15
Loc: Ohio
I was very excited to see something so simple, but it still won't attach the pdf. I added the local variable to the body of my recipiant's email to make sure the value of the variable is correct, and it added the correct value just fine to that.
The path is correct and the name of the local variable corresponding PDF is correct in that folder. The folder is located on the 'C' drive of the Planet Press server and is a shared folder for everyone.
What am I missing??

Top
#40364 - 08/10/12 10:30 AM Re: using local variable to name file attachment [Re: Tracey Y]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
Tracey,

Could your local variable %{af_ToAddress} already contain the file extension? That's an easy thing to miss.
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#40365 - 08/10/12 10:42 AM Re: using local variable to name file attachment [Re: Tracey Y]
Tracey Y Offline
OL Newbie

Registered: 02/02/12
Posts: 15
Loc: Ohio
I went back in and attached the actual file name and it worked perfect. I just can't get the variable named file to attach.

Top
#40367 - 08/10/12 11:07 AM Re: using local variable to name file attachment [Re: Tracey Y]
Tracey Y Offline
OL Newbie

Registered: 02/02/12
Posts: 15
Loc: Ohio
It shouldn't contain the extension as it only contains the exact information that we type in that field. It is used on another design in a different workflow to get an email address from the field that we are manually overwriting when we send the data to the current workflow.
is there any need to trim the data?? it doesn't look like it does.


Edited by Tracey Y (08/10/12 11:08 AM)

Top
#40370 - 08/10/12 12:52 PM Re: using local variable to name file attachment [Re: Tracey Y]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
It occurs to me you said you use this variable in another workflow. If that's the case, then it's a global variable, and therefore the notation for it should be
Code:

%{global.af_ToAddress}



If that's not the case, then perhaps there's an extra space in the variable contents. If you want to trim it, you can use the Math Expression task right before sending the file to PlanetPress Image:
Code:

In the "Math Expression" field:
  trim(watch.getvariable("af_ToAddress"))

In the "Store Results in" field:
  af_ToAddress



Let us know how it goes.
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#40371 - 08/10/12 03:37 PM Re: using local variable to name file attachment [Re: Tracey Y]
Tracey Y Offline
OL Newbie

Registered: 02/02/12
Posts: 15
Loc: Ohio
I did some further digging and found that the variable is assigned many charactor spaces longer than what information has been input into the field it is pulling data from.
I went back into the definition of the variable in the workflow and changed ',NOTRIM' TO ',TRIM' and it worked!!!

Thanks for being a sounding board as well as great support help to me!

Top