Using Substitution on Text Field - Appian Expression Editor - saas

I am currently trying to figure out how to use the Substitute() function provided by Appian on a text field. Specifically, I am trying to substitute the "&" with & amp; because the ampersand is causing me issues when I try to save the form with a certain value.
Every combination that I've tried has given me an error that will either prevent me from saving my changes, or causes an error when I try to use the form it's related to. Has anyone used the Expression Editor in Appian before and knows how to use the substitution function with the code below?
We are currently using an older version of Appian (version 7.10).
Also - there is currently no tag available for Appian so I am unable to tag it properly :(
If there is any additional information I can provide to get this solved, please let me know.
a!textField(
label: "Line Item Text " & ri!index,
value: ri!items[ri!index].itemText,
saveInto:
{
ri!items[ri!index].itemText,
if(rule!APN_isBlank(ri!write), {}, a!save(ri!write, false))
},
align: "RIGHT",
required: true,
validationGroup: ri!validationGroup
)

Here is a snippet:
load(
local!sample: "123&gas",
substitute(local!sample, "&", "& amp")
)

Related

Grafana: Overrriding series with metric named `/var(avail_MB)`: "Panel rendering error '/var(avail_MB)' is not a valid regular expression."

An Icinga2 plugin (written by myself) returns performance data with metrics named /var(avail_MB), /var(total_MB) and similar. Data is forwarded to an InfluxDB with Grafana as Frontend.
I'm using "GROUP BY" "tag(metric)" and "ALIAS BY" "$tag_metric" in a dashboard's panel query.
The metric names are displayed correctly below the graph then.
However when I try to override series by specifying "alias or regex" /var(avail_MB) it does not seem to work, and when going back from panel configuration to dashboard, I get an error message saying "Panel rendering error '/var(avail_MB)' is not a valid regular expression.".
I tried to put a backslash in front of ( and ), but that didn't help.
To make matters worse, the whole graph disappeared, and when trying to open the "Query Inspector", the frontend seems to take forever (Query never appears).
What is the problem, and how could I fix it?
I'm new to Icinga2, Grafana and InfluxDB (I'm just a "user" not administrator of those).
The color change is not applied to the graph.
Here is an example of plugin output:
OK: /var: 3114/5632MB (55.30%), slope is NaN|/var(total_MB)=5631.56MB;;;0 /var(avail_pct)=55.30%;25;5;0;100 /var(avail_MB)=3114.12MB;10;5;0;5632 /var(est_avail_MB)=nanMB;10;5;0;5632
(The "nanMB" was a bug in the plugin that has been fixed already, but that data wasn't from the machine in question.)
The problems seems to be the beginning of the string ("/var").
Grafana seems to treat every string starting with / as regular expression, and it expects any regular expression to start with /, too (it seems).
So the fix was to add a trailing /, and escape the literal / as \/.
Unfortunately this only removes the error message, but doesn't make the override work (match).
It is also required to backslash-escape the parentheses and the slash(es):
Instead of /var(total_MB) you need to write /\/var\(total_MB\).
The original problem has two origins:
The monitoring plugin specification at https://www.monitoring-plugins.org/doc/guidelines.html#AEN201 states: "2. label can contain any characters except the equals sign or single quote (')") states that any character except = and ' is allowed as metric name.
Grafana v6.7.3 proposes the incorrect (i.e.: unescaped) values for "alias or regex".
That is how I had created the problem.

Tableau: filter value N/A in the URL not working

One of my filters has value "N/A" and I want to pass it in the URL when a dashboard is opened. We are also using JS API to embed dashboards and our Tableau Server Version is 2019.3.1
I have tried many things but the filter does not load with N/A applied. I have checked the tableau kb article https://kb.tableau.com/articles/issue/special-characters-in-url-parameters and tried but it does not work.
Passing N/A in the url
%26Operator%3DWolverine%26State%3DUtah%26First%5c%20Production%5c%20Year%3DN%5C%2FA
&Operator=Wolverine&State=Utah&First%5c%20Production%5c%20Year=N%5C%2FA
&Operator=Wolverine&State=Utah&First+Production+Year=N%5C%2FA
&Operator=Wolverine&State=Utah&First+Production+Year=N%2FA
I have also tried to pass the value in JS like below
tableauViz = new tableau.Viz(frameDiv[0], url, {
highdpi: true,
hideTabs: true,
hideToolbar: true,
"Operator": "Wolverine",
"First Production Year": "N/A",
});
But none of the above work, has anyone encountered such issue? Any help in this would be greatly appreciated.
I am fairly certain however you attempt to pass N/A, that / is going to be interpreted as a locator. I would suggest you add in some logic in the JS to interpret N-A, or NA, or Z35 as your N/A. Either that or add a calculated field and a case statement to convert your N/A to a number.
An excerpt from the link you included in your question, states / is a reserved character.
Network Working Group: Uniform Resource Identifiers (URI): Generic Syntax - 2.2.
Reserved Characters.
According to the above resource, the following characters are "reserved" (likely to cause errors in URLS unless encoded): ! * ' ( ) ; : # & = + $ , / ? # [ ]

Exist is always coming TRUE in UFT when using index to identify Browser

I've to get the number of opened browsers having some title. The approach that I used was using the index. But the problem is, whatever index I pass, Exist function is always returning true.
Browser("openurl:=.*something.*", "index:=0").Exist => True
when i change the index to 10 or some other number, it still returns me True even if there is only one browser window. My problem statement is to find any new browser window opened after a click of a button, this window can be a pdf or csv file. After identifying the window (by using index in my case) I've to get the visible text of the window.
PS: I'm new to UFT, have worked on automation using selenium tool.
The index (or any ordinal identifier like CreationTime) are used only if the description matches multiple Browsers, if the description you supply only matches one object it will be ignored.
I tried with two open tabs and got the following results:
Print Browser("opentitle:=.*", "index:=10").Exist ' => False
Print Browser("opentitle:=.*Example*", "index:=10").Exist ' => True
If you're seeing different results I would suggest try using the undocumented function Highlight to see which Browser UFT thinks matches your description.

SSIS Formatting input from flat file

I'm a SSIS newbie. I wanna format the inputs of my flat file before saving the entries in a database table. Initially I created a flat file as follows:-
"1","Superman","Metropolis"
"2","Batman","Gotham"
"3","Spiderman","New York"
"4","James Bond","London"
"5","Green Lantern","Oa"
The solution for stripping this was simple as shown here http://www.mssqltips.com/sqlservertip/1316/strip-double-quotes-from-an-import-file-in-integration-services-ssis/
But now i have created a new similar package and given my input file like this:-
"6", "TMNT", "Sewers NY"
"7", "Iron Man", "New York"
Note here I've put a space after the delimiting comma. Now when I follow the above method the first number field stripped of the double quotes, but rest of the entries retain their quotes. Any idea how to work around this? One suggestion on a similar question on stackoverflow mentioned use of a "Transformation script". Since I'm a newbie can anyone please throw light on this method?
Yes, you can use Script component transformation. Select all columns, and change them to ReadWrite. The code:
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
Row.ID = Row.ID.Replace("\"", string.Empty);
Row.Movie = Row.Movie.Replace("\"", string.Empty);
Row.City = Row.City.Replace("\"", string.Empty);
}
If you want to trim the spaces you can use
Row.ID.Replace("\"", string.Empty).Trim();
You would also need to take care if you want to preserve the values that are " ". Please post if the suggestion was helpful or if you have any questions.
In the 'General' tab you can set a text qualifier of ". Then those quotes will be ignored.
Then you don't need to write error prone script when there is a simple solution.

JQuery UI Autocomplete returning all values

I have the following code:
$("#auto").autocomplete({
source: "js/search.php",
minLength: "3" });
This code is assign to an input text box where i type a name and after 3 letters it should return the ones that have similar letters. For my case it is returning all values, even those not related to the 3 letters already typed. My question is:
How to send my search.php file the value inside the input so it should know what to search for. For the moment it searches for everything. I checked the value that was going to php and it was empty. Since the query to mysql uses LIKE '%VARIABLE%' and the variable is empty it searches for '%%' which is all cases.
How can i send the correct informacion from JS to PHP with the simplest form.
Here is the explanation :
http://www.simonbattersby.com/blog/jquery-ui-autocomplete-with-a-remote-database-and-php/
Regards