Automic Workload Automation

Expand all | Collapse all

Ampersand (&) in Prompt Value

  • 1.  Ampersand (&) in Prompt Value

    Posted Oct 12, 2015 06:03 PM
    Has anyone dealt with an & in a Promptset Value?

    I was able to get the & to pass all the way to the Agent by putting three ampersands (&) in the Promptset Variable to escape it. The first escapes for the Promptset, so that when the job executes it gets &&, then inside the job it sends just a single & to the Agent for execution.

    But now what happens is that I get an Fault in Post Processing because it takes the double (&&) and seems to evaluate it to a single, where it then assumes that it is a variable that needs to be replaced.

    Because Automic does NOT allow editing of Promptset Variables inside the job, it won't let me do a STR_SUB to either remove or replace the ampersands.

    Any thoughts?


  • 2.  Ampersand (&) in Prompt Value

    Posted Oct 12, 2015 07:00 PM
    I ran into a similar issue with special characters in names. 

    I use the CallAPI to kick off the notification for our Password resets. In the script we pass in the First Name, Last Name, email to the Notification job.
    I found that if the requestor had a special character in their name, like René, the AE would interpret it as René.

    Since we were using the HTML email notification, we had to pass it as the HTML code for the email to correctly display it.
    The HTML code for é is é . So even adding a 2nd && so the PromptSet passed it as a literal &, the tasks within the workflow tried to evaluate it.

    To get around this, before executing the CallAPI, we replaced the & with a random pattern in this case '0a0' and then in a Script object as the first task, I replaced the '0a0' with '&&' which then the jobs further down interpreted as a literal &.

    :pset &fname#=str_sub(&fname#,"0a0","&&")
    : p &fname#

    ovkvwfl2xjcm.pnghttps://us.v-cdn.net/5019921/uploads/editor/yu/ovkvwfl2xjcm.png" width="761">



  • 3.  Ampersand (&) in Prompt Value

    Posted Oct 12, 2015 07:06 PM
    Technically, I could do the STR_SUB in the Pre-Process step of the job. The Problem is that the variable is a PromptSet variable which for some reason is read-only, once the job is executing. So the PSET won't work.

    So I'd have to store the value in a different variable, which I was trying to avoid.


  • 4.  Ampersand (&) in Prompt Value
    Best Answer

    Posted Oct 12, 2015 08:32 PM
    If the PromptSet is on the task, then correct, you can't use a PSET to change the value since it's evaluated at the same time as the Pre-Process tab.

    In my case, the PromptSet is on the Parent workflow and passed to the tasks, which is why I am able to manipulate the variable with the Script object.

    Evaluation of Variables and PromptSets gets a bit confusing....


  • 5.  Ampersand (&) in Prompt Value

    Posted Oct 16, 2015 07:07 PM
    I told the users of the Prompt Value that they can't use & due to Automic special character. That was the simplest solution.


  • 6.  Ampersand (&) in Prompt Value

    Posted Apr 17, 2017 10:58 PM
    I decided not to open new issue on this question.
    Hopefully I will get some responses.

    I searched documentation and there is not much info how to properly escape special characters in Promptset values.
     
    I have similar problem when we try to pass following URL (direct link to ARA Execution) as a value in Promptset and the script is breaking at "&" special character.

     
     Did anyone found more straightforward solution how to pass "&" as part of the value in Propmtset?
     
     Thanks,
     
     Vlad Navazhylau


  • 7.  Ampersand (&) in Prompt Value

    Posted Apr 18, 2017 12:33 PM
    Interesting challenge.  The problem still exists in 11.2.1.   I haven't been able to find any solutions.  The only workaround I have achieved is to expect the customer to use a substitute input character, and then run the str_substitute() function to convert the substitute character to an ampersand, which of course requires a new variable to hold the results.


  • 8.  Ampersand (&) in Prompt Value

    Posted Apr 18, 2017 12:37 PM
    According to this thread, you could work around this PromptSet problem by using the  :READ method instead of a PromptSet;
    https://community.automic.com/discussion/7845/how-to-read-a-variable-with-ampersand



  • 9.  Ampersand (&) in Prompt Value

    Posted Apr 18, 2017 12:39 PM
    I've also discovered that if the customer inputs a double-ampersand, it works and resolves to a single ampersand.

     https://our-ara-domain.com:8443/ecc/#bond-p/executions/properties&&oid=617635


  • 10.  Ampersand (&) in Prompt Value

    Posted Apr 21, 2017 11:50 AM
    Pete,

    Thank you for your feedback.
    Unfortunately double "&&" did not worked for us.

    We end up using URI encoded value for "&" which is "%26".

    This worked OK for us for the use case that we had.



  • 11.  RE: Ampersand (&) in Prompt Value

    Posted Jun 02, 2020 05:57 PM
    Edited by Pete Wirfs Jun 02, 2020 05:58 PM
    I just ran into this problem myself today on V12.3.0.  I wanted to include a URL as a default value inside of a promptset, but the ampersands in the URL caused UC4 failures.  The %26 trick did not seem to work.  So the workaround I settled on was to use https://cutt.ly/ to create a short alias to the URL in question.

    ------------------------------
    Pete Wirfs
    SAIF Corporation
    Salem Oregon USA
    ------------------------------



  • 12.  RE: Ampersand (&) in Prompt Value

    Posted Nov 03, 2020 04:45 PM
    Edited by Johnny andrey Nov 03, 2020 04:48 PM
    Hello @Pete Wirfs

    But in this case it would depend on the page https://cutt.ly/ in case it falls or something fails in it

    our workflow would fall

    I'm having the same problem

    ------------------------------
    Computer Engineer
    N.A.
    -------------- ----------------
    ---------------------------------- ---------


  • 13.  RE: Ampersand (&) in Prompt Value

    Posted Nov 03, 2020 05:17 PM
    Can you break the string into two variables, and combine them with an ampersand with scripting?

    ------------------------------
    Pete Wirfs
    SAIF Corporation
    Salem Oregon USA
    ------------------------------



  • 14.  RE: Ampersand (&) in Prompt Value

    Posted Nov 03, 2020 06:18 PM
    Hi, this is my chain.

    --------------
    https://adevops.exe.com.co/ads/Colom/_apis/builds/artifacts?=123-20201002&api-version=2.0&%24%20format=zip
    -------------------

    It is not possible to divide it because it has several ampersand 

    ------------------------------
    Computer Engineer
    N.A
    ------------------------------