Automic Continuous Delivery Automation

 View Only

 Special character showing error (@,$,etc)

Mohammed baabbad's profile image
Mohammed baabbad posted Dec 13, 2022 01:47 AM
Dears ,

we are in production mode and we face some big issue that when the client provide special character it showing error , the client provide is PWD for credential matter 
we try to split the text also we failed and using percentage sign also failed 

so if any body can help us to how fix this issue

thanks 

Mbaabbad
Michael Dolinek's profile image
Broadcom Employee Michael Dolinek
Hi @Mohammed baabbad

In order that the community can provide some feedback to your problem, please describe your use case in more detail
  • where do you set the password (Login-object, protected password-field as part of a PromptSet-object.....)
  • where / how do you use the variable that holds the password (Jobs....)
  • which component's version you are using (AWI, AE, Action Pack...)

Thanks Michael
Mohammed baabbad's profile image
Mohammed baabbad
Dear Michael,
 Just consider a simple string handling case:
 &str# = &myInputPromptString#
 ! consider simple case
 &myInputPromptString# = "&This is what user has input!"
 :Print &myInputPromptString#
 :Print "It never reaches here and fails apart un-able to handle amp"
 :Print "Even If I put two amp or split string and join again - no solution"
 ! Now consider simple case
 &myInputPromptString# = "&This# is &what# user has input[]()<>~!"
 :Print &myInputPromptString#
 :Print "It never reaches here and fails apart un-able to handle special chars"
 :Print "Even If I put two for each or split string by char and join again - no solution"
 Please Help Urgently.
 Sincerely,
 Baabbad in Trouble
Michael Dolinek's profile image
Broadcom Employee Michael Dolinek
Hi @Mohammed baabbad

Currently the Automation Engine interprets the term &name# in a string as a variable. In order to prevent this, two & must be used.

:Set &myString1# = "&&This is what user has input!"
:Print &myString1#
:Print "amp must be duplicated"

:Set &myString2# = "&&This# is &&what# user has input[]()<>~!"
:Print &myString2#
:Print "amp must be duplicated"​


see also https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/21.0.4/Automic%20Automation%20Guides/Content/Script/Writing/Script_Elements_and_Syntax.htm

Note: If you include a variable and your data line requires an ampersand before the variable, make sure you write both ampersands. When the script is processed, the script variable along with the ampersand in its name is replaced with the value that is assigned to the variable. If you use an ampersand without writing a valid variable name after it, the data line remains unchanged.

If this is a password field there is no need to double the ampersand but you have to use Job Messenger to get the password in clear text.
​see https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/21.0.4/Automic%20Automation%20Guides/Content/AWA/AdministrationPerspective/AG_Agent_JobMessenger.htm
Within this command, you can also use passwords that have been encrypted by using a PromptSet object: specify the PromptSet variable that includes the value of the encrypted PromptSet text field. The Job Messenger automatically identifies and decrypts the passwords. 

Hope this helps!