How to query sharepoint search api where column value contains space - sharepoint-2013

I am trying to run a SharePoint api query to match against a column with a specific value.
The column value contains a space which is resulting in the query not working as expected. Returning anything with 'value' in the column rather than just items where the column = 'value 2'.
My current url looks like where $listId is a list guid
https://mysite.sharepoint.com/_api/search/query?querytext='(customColumn:value 2)+AND+(ListID:$listId)'&selectproperties='Name,Title,Description,Author,LastModifiedTime,Path'
What is the syntax for
(customColumn:value 2)
That allows me to only return results where customColumn = "value 2"?

Try to encode the endpoint as
_api/search/query?querytext='customColumn:value%202'
My test Sample:
/_api/search/query?querytext='Title:Developer%20-%20Wiki1 Author:Lee'

Related

Retriving the 'match' patterns from the column of a dataframe and append in list

I want to retrieve the values of order numbers and store it in a list. But the problem is I am able to fetch one not the other
ID Order
test#xyz.com 1-1155945200890<<<<able to fetch this
test1#xyz.com Hi how are you? 1-1155945200890<<<not able to fetch
By using below I am able to retrive the values to those column which do not have the junk data with it like that of just '1-1155945200890' but not from 'Hi how are you? 1-1155945200890'
To define feedback:
for user in users:
intent_name=data_to_analyse2.loc[data_to_analyse2['ID'] == user]
intent_list=list(intent_name['INTENTNAME'])
feedback=list(intent_name['Input'])
to fetch the match pattern:
pattern=re.compile("1[\-][\d]{2,15}")
pattern_list=list(filter(pattern.match, feedback))
How can I get all the values to the matching expression even if it has junk data associated with it

Datastore ListProperty query inconsistency

I'm trying to run a query on a ListProperty field named "numericRange". There is a row that has value ["3","5"] for this field. I want to verify that value "4" belongs to this range.
If I run the next query on GQL console, datastore returns results (because the first value "3", matches):
select * from example where numericRange<=4
If I run the next query, also datastore returns results (because the second value "5", matches):
select * from example where numericRange>=4
However If I run the next query, datastore doesn't return results:
select * from example where numericRange<=4 and numericRange>=4
Why does it work on the first and second queries, but not on the third query?
Thank you in advance.
Cloud Datastore flattens your list for the indexes. So your query numericRange<=4 and numericRange>=4 is checking the index to see if (3<=4 and 3>=4), and if (5<=4 and 5>=4). As you can see, with a flattened values in the index your 3rd query will only return results when numericRange has a value in the list of exactly 4.

Unable to get the vlookup property

Attached image is my my table from which I am trying to fetch the value of the input.
I have written a lookup statement for that. However I get error "unable to get the vlookup property of the worksheetfunction class"
I have stored the input in "Postcode".if the postcode is AB1 0, it has to return value 0.
PC = Application.WorksheetFunction.VLookup(Postcode, _
Worksheets("G010").Range("A2:A12610"), 2, True)
One issue you have is that you will never find something in the second column of an array that has only one column.

Using list manager in Oracle Apex 5

Am building an application with oracle apex 5 where i want the user to chose multiple parameters and returning an interactive report based on the parameters selected by the user.
One of the parameters is a list manager item where the user select multiple values to be passed to an SQL query.
my problem is how to pass those values to the sql query, the item type is list manager and the name is P2_OPTIONS how do i pass the parameters to the SQL query generating the report.
Selected values storing in P2_OPTIONS divided by colon, for example 2:7:17.
So, you can insert this string into your query, preliminary replacing colon to comma and get expression like
...
and parameter0 in (2,7,17)
...
OR
you can parse this string into apex collection and join this collection in you query
...and apex_collections.collection_name = 'P2_OPTIONS_PARSED'
and parameter0 = apex_collections.c001
...

Python dictionary map to SQL string with list comprehension

I have a python dictionary that maps column names from a source table to a destination table.
Note: this question was answered in a previous thread for a different query string, but this query string is more complicated and I'm not sure if it can be generated using the same list comprehension method.
Dictionary:
tablemap_computer = {
'ComputerID' : 'computer_id',
'HostName' : 'host_name',
'Number' : 'number'
}
I need to dynamically produce the following query string, such that it will update properly when new column name pairs are added to the dictionary.
(ComputerID, HostName, Number) VALUES (%(computer_id.name)s, %(host_name)s, %(number)s)
I started with a list comprehension but I only was able to generate the first part of the query string so far with this technique.
queryStrInsert = '('+','.join([tm_val for tm_key, tm_val in tablemap_incident.items()])+')'
print(queryStrInsert)
#Output
#(computer_id,host_name,number)
#Still must generate the remaining part of the query string parameterized VALUES
If I understand what you're trying to get at, you can get it done this way:
holder = list(zip(*tablemap_computer.items()))
"insert into mytable ({0}) values ({1})".format(",".join(holder[0]), ",".join(["%({})s".format(x) for x in holder[1]]))
This should yield:
# 'insert into mytable (HostName,Number,ComputerID) values (%(host_name)s,%(number)s,%(computer_id)s)'
I hope this helps.