Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: BPA Constant in text file
Topic Summary: Is there a way to pull and use a constant from an an external text file?
Created On: 04/17/2015 06:44 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 04/17/2015 06:44 AM
User is offline View Users Profile Print this message

Author Icon
EduardoRea
Student (5-19 posts)

Posts: 18
Joined: 04/23/2014

Hello, 

I had a question about constants. I wanted to store a listing of records in a text file but i wanted to use a constant. 

C:\Example.txt:

%Constant1%

%Constant2%

 

But everytime i read in the text file the constant isnt translated, it always stays as the text "%Constant1%". is there a way to use a constant from an external file? Thank you!

 



 Category Survey
AutoMate BPA Server 9 version: 9.0.4
Windows version: Windows Server 2008 R2
 04/17/2015 08:02 AM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

Eduardo,

Please post the contents of your task using the Attach Code button so we can review your specific scenario.




 Category Survey
AutoMate BPA Server 9 version:
Windows version:


-------------------------

Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665
 04/17/2015 08:12 AM
User is offline View Users Profile Print this message

Author Icon
EduardoRea
Student (5-19 posts)

Posts: 18
Joined: 04/23/2014

Hello, 

Here is the basic logic. I also attached the sample text file. 

As the task is reading the text file the constants arent updated with their values. 



 Category Survey
AutoMate BPA Server 9 version: 9.0.4
Windows version: Windows Server 2008 R2



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)



 04/17/2015 12:55 PM
User is offline View Users Profile Print this message

Author Icon
Valentineo McGowan
HelpSystems

Posts: 766
Joined: 09/03/2013

Hello Eduardo,

1 I believe there may be some confusion about the use of Constants in BPA Server 9.
Constants are created and managed in the SMC under Options > Server Settings > Constants
They may then be referenced within Tasks.
http://www.networkautomation.c...onstants_Settings.htm

2 What you are attempting to do is something completely different.
What precisely is contained within the DeletFolders.txt file? Is it file system paths to be referenced? If so, why not create a constant for it within the SMC and reference them?

 Category Survey


-------------------------

Valentineo McGowan | Technical Consultant
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1 213.738.6966 | F: +1.213.738.7665
 04/17/2015 01:58 PM
User is offline View Users Profile Print this message

Author Icon
EduardoRea
Student (5-19 posts)

Posts: 18
Joined: 04/23/2014

Hello, 

I think you are misunderstanding what i am trying to do.

The constants are setup in BPA and have values. 

Example: %Constant% is setup and has the name of a Network Computer. Lets call it "PC1". 

So %Constant% = "PC1"

DeleteFolders.txt is just an external listing of values that can contain something like "\\%Constant%\Directory1\TempFolder\"

When BPA reads this line, i would like it to then translate %Constant% to its value, which is "PC1" and then have the value = "\\PC1\Directory1\TempFolder\". 

The issue is, that does not happen. The text always stays as "\\%Constant%\Directory1\TempFolder\".

 

Is there a command or way to have BPA recognize the constant and pull the value?

 



 Category Survey
AutoMate BPA Server 9 version: 9.0.4
Windows version: Windows Server 2008 R2
 04/17/2015 03:37 PM
User is offline View Users Profile Print this message

Author Icon
Valentineo McGowan
HelpSystems

Posts: 766
Joined: 09/03/2013

Hello Eduardo,

When the task reads the file it is reading it as text within that file and treats it as text accordingly. This is why it is not resolving.
If you want the machinenames to be evaluated and resolve accordingly they need to be referenced within the action/step itself.


 Category Survey


-------------------------

Valentineo McGowan | Technical Consultant
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1 213.738.6966 | F: +1.213.738.7665
 04/20/2015 08:31 AM
User is offline View Users Profile Print this message

Author Icon
EduardoRea
Student (5-19 posts)

Posts: 18
Joined: 04/23/2014

Gotcha, thank you!



 Category Survey
AutoMate BPA Server 9 version: 9.0.4
Windows version: Windows Server 2008 R2
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1121 guests browsing this forum, which makes a total of 1121 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog