Unique value with Xquery and SoapUI - xquery

First of all, Sorry if I do mistake in my question. I'm french and not the best in english.
I have a problem with a Xquery Match in Soapui.
There is an exemple of a Soapui response:
<ns0:Group>
<ns0:Personne>
<ns0:idPersonne>111</ns0:idPersonne>
</ns0:Personne>
<ns0:Personne>
<ns0:idPersonne>222</ns0:idPersonne>
</ns0:Personne>
<ns0:Personne>
<ns0:idPersonne>333</ns0:idPersonne>
</ns0:Personne>
</ns0:Group>
I need to check if the Id of a personne is unique or not.
If "111" appears only once, it returns "true"
If not, it returns "false".
Could you help me?

This should do the trick for you:
count(distinct-values(//ns0:idPersonne)) eq 1
I am not that familiar with Soap UI though, so if you have trouble with namespaces you might also like to try instead:
count(distinct-values(//*:idPersonne)) eq 1

Related

Reading Issue Fields via Workfront-API

Please tell me how to read Issue Fields like resolveProjectID & resolveTaskID:
****.workfront.com/attask/api/OPTASK/search?id=5bf801f101b144a12aabb51f2c068caa
returns:
{"data":
[{"ID":"5bf801f101b144a12aabb51f2c068caa",
"name":"test-dev-issue","objCode":"OPTASK",
"plannedCompletionDate":"2018-11-27T00:00:00:000+0200",
"status":"NEW",
"primaryAssignment":null}]
}
According to the API-Explorer guide (https://support.workfront.com/hc/en-us/articles/220633507-API-Explorer), resolveProjectID & resolveTaskID should be located within OPTASK fields. I couldn't find anything helpful yet within their documentation.
Thank you!
The search you're executing will work, but if you know the ID of the record you're retrieving then you should call it directly (/api/v9.0/OPTASK/5bf801f101b144a12aabb51f2c068caa).
The return value is, by default, a small set of fields providing some basic data. If you want more fields, add a parameter (fields=).

Google Data Studio Case Logic Using REGEXP_EXTRACT

I am trying to create a dimension in Google Data Studio but can't. I get no error, just a red line under the dialog box (which I guess is an error).
CASE WHEN REGEXP_MATCH(Landing Page, 'foo') THEN "Bar" ELSE "Other" END
I am not sure what is wrong with the format. Has anyone been able to get this to work?
The syntax requires a .* for wildcards. My original code was searching for exact match.
Here is the updated code for wildcards:
CASE WHEN REGEXP_MATCH(Landing Page, '(foo.*)') THEN 'Bar' ELSE 'Other' END

Use two taxonomy terms in one URL WP-API

At the moment I'm calling taxonomy term data using URL's like this -
http://scd.blaze.wpengine.com/wp-json/posts?type=listings&filter[listing_area]=northwest
Is there a way I can call two taxonomy terms at the same time, something like this? -
http://scd.blaze.wpengine.com/wp-json/posts?type=listings&filter[listing_area]=northwest&filter[listing_area]=northeast
I've read through all documentation but I'm struggling to find a solution, andy help would be much appreciated, thanks in advance!
Without knowing the full code in place its hard to be 100% but try...
http://scd.blaze.wpengine.com/wp-json/posts?type=listings&filter[listing_area][]=northwest&filter[listing_area][]=northeast
By adding [ ] to the end of each reference to listing_area you are now passing through an array of values. Otherwise you just pass through the last value in the query string.

linked in IN.API.Raw

/people-search:(people:(id,first-name,last-name,date-of-birth,summary,industry,group-memberships,job-bookmarks,interests,associations,public-profile-url,picture-url,headline))?keyword=retail&count=500
the above search gets me all my connections when it is just suppost to get the ones in retail.
?keyword=cytdcytxyrtr4dftubiugiuguukjkjp
this does the same...
I am glad that I get 'a' result but why aren't params working?
I think it's "keywords" plural. Does that fix things?

SQL Search Statement like Google?

Is there some kind of SQL Statement that I can used to do a search on 1 Column in my table that is similar to what I am looking for.
Like if I am looking for something to do with a "Car" but I spell it as "Kar" it must return items of "car".
Or
If I am looking for "My Company" and I spell it as "MyCompany" it must still retun "My Company".
Select * from TableName where Column Like '%company%' will return "My Company" but I need more as the user will not always know how to spell. So I need something more advanced like some small Google App or something...
That feature is in the text services so if you build a full-text search index, you should be able to use the feature.
Have a look here:
http://msdn.microsoft.com/en-us/library/ms187384.aspx
http://msdn.microsoft.com/en-us/library/ms142571.aspx
This is quite an involved problem. The quick answer is to use the SQL Server soundex algorithm, but it's pretty hopeless. Try the suggestions on this SO answer. (Updated)
Read this blog post: http://googlesystem.blogspot.com/2007/04/simplified-version-of-googles-spell.html
This is something you could implement with SQL, but it's not a built in feature.
Another way to help you users find what they are looking for is to implement type-ahead on the search field. If the user type: "my" he will get "My Company" as a suggestion and likely go with that.
You can easily implement type ahead using jquery or other javascript libraries. Here's a list of type ahead plugins for jQuery: http://plugins.jquery.com/plugin-tags/typeahead
No. A full text index might get you closer, depending on your requirements (what exact features are you looking for?) One option would be roll you own .NET assembly with the desired features add it (CREATE ASSEMBLY) to sql server and use that to search.

Resources