Excel Power Query: Passing parameter to oDataFeed URL throws error - odata

When a direct number for the TestPlanID is given it works.
When passing the value from sheet to a Query and then appending it to URL throws an error.
Expression.Error: We cannot apply operator & to types Text and Number.
Details:
Operator=&
Left=https://analytics.dev.azure.com/OrgName/ProjName/_odata/v3.0-preview/TestPoints?$apply=filter((TestSuite/TestPlanId eq
Right=39128

Can you try
eq"""&varTPID&"""
If value of varTPID is an integer/decimal, can you change the first line in power query to varTPID=Text.From(varTestPlanID) and then use eq"""&varTPID&"""
Also I think, TestPoints?"&"$apply needs to be changed to TestPoints?$apply

Related

Resolve DGET function "More than one match found" error

I am trying to match a list of range with certain criteria in a google spreadsheet. I am using DGET function for the same. Everything is working fine but the problem comes when there are many entries that contain the whole string and I receive "More than one match found in DGET evaluation.".
For the better understanding look below:
Sheet "Form Responses 1":
B
-------
Ronald
Ronaldo
Ronaldinho
Rebarto
Matching sheet entries:
A
------
Ronald
Rebarto
Juhino
My Formula is:
=DGET('Form Responses 1'!B:H,"Date",{"Email Address","Logging In or Logging out ?","Date";A2,$B$1,$H$1})
Now the problem is Ronald is matching with "Ronald","Ronaldo" and "Ronaldinho" and I am receiving the error which says "multiple entries found".
How do we solve this?
I solved the problem by Concatenating a constant variable before and after the name. For example Ronaldo becomes mRonamdom and Ronald becomes mRonaldm. This makes the Names Unique and solves the problem.
If you don't want to modify the data but to fix the formula so it doesn't get confused with similar entries in your database parameter you can add a character to the criteria field of the dget function as shown below (I'm using an '=' sign concatenated to the value I want to match with in the database parameter)
=dget(database!$A$1:$B$11,$M$1,{"columnName";"="&F2})
where
A1:B11 is my database
M1 is the matching column name
and "="&F2 is the field with the caracter I chose that I want to match with to retrieve values from the matching database column, now even if the there are more than one matches found (becuase matching substrings"), the addition of the caracter contatenated with the matching value, should take care of the in-accurate error.

In QUERY on unique values, NO_COLUMN error

I have a list of U.S. states where duplicate values are also available. I need to find how many unique states are there in a list.
'Unique' function returns all the unique states but in conjunction with 'query' function the following error message is returned:
Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: A
=query(unique(A3:A26),"Select count(A)")
What am I doing wrong?
Having reconstructed the data (after UNIQUE it is different) you can't then continue with letters for column references. So:
=query(unique(A3:A26),"Select count(Col1)")

Type of the parameters passing in stored procedure

how to check a parameter is string or number in stored procedure??
based on the incoming parameter type I want to work on the functionality
for example: if string i will search by name, if the number I will search by phone number
Please try below whether this is helpful.
Check your input parameter using below sample function ISNUMERIC and if it returns 1 then it is numeric value. In your case it is phone number. else it is address.
SELECT ISNUMERIC('4567');

How to set up parameters of a stored procedure in JMeter using a JDBC Request

I am planning to load the database using a stored procedure callable statement. The test plan I am creating in JMeter looks like below:
- Test plan
- Thread Group
- JDBC Connection Configuration
- JDBC Request
- View results tree
- Summary Report
JDBC Connection Configuration is based on tests that already work.
The question is with my JDBC Request:
Variable name: is the database name same as in JDBC Connection configuration
Query Type: Callable Statement
Query: {call schema.dbpk_utilities.get_user_id(?,?,?,?,?,?,?)}
Parameter values: S12345, HR, OUT, NULL,NULL,NULL, NULL
Parameter Types: VARCHAR, VARCHAR, INTEGER, VARCHAR, VARCHAR, VARCHAR, VARCHAR
Variable names: username,hr, id, four, five, six, seven
The error I get is:
Response message: java.lang.NumberFormatException: For input string:
"OUT"
Can anyone tell me why the response message? Is it possible to call Stored procedures in JMeter? I am struggling to OK this request!
Following the 'no space rule' from the previous post I found out why the request was responding with java.lang.NumberFormatException: For input string: "OUT" message. See below
Variable Name: Oracle
SQL Query: Callable Statament
Query: {call nspishr.dbpk_user_utilities.get_user_details(?,?,?,?,?,?,?)}
Parameter Values: S12345,DMS,OUT,NULL,NULL,NULL,NULL
Par Types: VARCHAR,VARCHAR,OUT INTEGER,VARCHAR,VARCHAR,VARCHAR,VARCHAR
Variable names: username,dms,id,four,five,six,seven
Notice how the parameters are registered in this call. In my procedure param 1 and param 2 are IN parameters. These are made IN parameters implicitly by giving them a parameter value S12345 and HR in my case.
From param 3 all the way to param 7 are OUT parameters. Param 4, 5, 6 and 7 have NULL values. Therefore no need to register them as OUT parameters. Param 3 (the id), however, is the OUT parameter and it has to be registered as such by explicitly saying OUT in the parameter value and then saying OUT INTEGER in the parameter types section. The thing to remember is that you need to specify OUT in both parameter value and parameter type. Not to forget the datatype of the parameter in the parameter types field. ie OUT INTEGER, OUT VARCHAR ...
Hope this helps
Whenever I have to provide JMeter with a comma-separated list, I make sure there are no spaces before/after the commas. I call this the 'no spaces' rule.
The poster sqeeky has also discovered this trick here, where sqeeky said:
do NOT have any whitespace after the comma separating the parm names so instead of '${appid_1}, ${appid_2}' (where you can see there is a space separating the ParameterName values, specify ${appid_1},${appid_2} instead as the values in the ParameterName list - otherwise in this example ${appid_2} won't be included.
All three of your comma-separated lists (Parameter values, Parameter Types, Variable names) violate the 'no spaces' rule. Try taking out all spaces in all three lists and trying again.
I checkout out the doc and unfortunately, I saw no references to the 'no spaces' rule, or perhaps the wording didn't reach out and grab me.

Jira Rest Api JQL isnt working using &

Iam using the Jira Rest Api to read data from our Jira-System. In most cases this works fine but i have a problem if & is in query.
I try following query:
http://jira-test.meinServer.de/rest/api/2/search?jql=labels="F&E"
which produces this error message:
"Fehler in der JQL-Abfrage: Die Zeichenfolge mit Anführungszeichen 'F' wurde nicht abgeschlossen. (Zeile 1, Zeichen 8)"
in englisch:
"Error in JQL-Syntax: The string with 'F' isn't closed. (line 1, char 8)"
I found that & is the problem. But i can't find some workaround or documentation how to escape this.
Someone got a solution for this?
You didn't encode your query string properly. Try: http://jira-test.meinServer.de/rest/api/2/search?jql=labels%3D%22F%26E%22
Reference
The part of an URI caught between ? and # characters is called the query string (the part after # is called fragment). Often the query is a sequence of key–value pairs (laid out as {key}={value}) separated with the & character.
If you analyze the URL you provided and split it by & you'll see that in fact you are passing two parameters in your query string:
parameter jql with a value of labels="F
parameter E" with no value
The second parameter is ignored as this particular REST endpoint doesn't expect it. As you can now clearly see you are passing a malformed JQL in your URL. It's because you want to include a special character in your JQL query.
To make it possible you have to properly encode your JQL. This is a common problem and most of the platforms provide tools to do that. Here are examples for JavaScript, C# and Java.
Click here to learn more about the query strings.

Resources