Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Variable problem on Save As to local folder


Level 3

I have a list of over 900 items, so I am trying to use a variable for the field value I need. I have given the SubstationName field the variable name sub. What is happening is the if statement works, and if the field is empty I get the alert. But it is also submitting. I need it to not submit unless the SubstationName field has a value.

And a second part, can the same variable be used in the save path name? I would like to go down another level of folder for each substation chosen so that each PDF is saved in a folder for that sub. It works as is and saves to the /c/SPCC/ folder, but I would like to go to, for example, /c/SPCC/Acton/

Thanks in advance.

var sub = SPCC.Body.TitleBlock.SubstationName.rawValue

if (sub == null) {

  app.alert("You must select a substation before you can save the file.");}

else (sub != null) {


myTrustedSpecialTaskFunc(this, "/c/SPCC/" + SPCC.Body.TitleBlock.SubstationName.rawValue + " " + SPCC.Body.TitleBlock.CurrentDate.rawValue + ".pdf");

app.alert("Your file has been saved as: " + SPCC.Body.TitleBlock.SubstationName.rawValue + " " + SPCC.Body.TitleBlock.CurrentDate.rawValue + ".pdf.","3");}

0 Replies