Cognitive Services Text Moderation Custom Lists - microsoft-cognitive

Is the listid functionality working for Text Moderation? I created a list and validated that it exists. However when I used the listid in text moderation, the terms from the list are not detected. I also tried using a non-existent listid in the call and no error was returned.
The list is made of simple chars "abc, def, ghi, ijk" and I modified the sample text on the Console page to include these terms. I turned off autocorrect to prevent these 'words' from being modified.

Steps to create and use custom lists of terms:
Use API to create list that will return a list Id
Use API to add terms to this list identified by its Id
Set the list identifier to listId query parameter on ProccessText/Screen API
Regards

Related

How to provide drop-down list of a specific resource types to choose from with ARM template

I'm trying to create an ARM template which queries the list of resources (i.e. Cosmos DB instances) in the selected resource group so the user can pick from the list. I then want to use the selected resource to get a property and use it elsewhere in the template.
I don't want the user to have to know the resource name and type it in, rather I'd prefer to produce a list to choose from.
I've tried using a parameter type of string or array along with the [list(resourceId('<id>', resourceGroup().name, '<date>')] but it doesn't produce a drop-down list.
Is this even possible?

Marketo REST API - what is "dedupeFields" for custom objects?

When it comes to creating/updating custom objects, can I use both dedupeFields or lookupField when pushing the data to Marketo?
What is the difference between the two?
I'm not sure what do you mean under lookupField, as there is no such input field described in the API documentation of the Sync Custom Objects endpoint. (That is the endpoint to create or update custom objects.)
In the other hand, you do not need such a standalone lookup field, as with the input array you provide the objects you want to create or update, with all their important values. Have a look at the sample payload in the docs.
When input is used together with the optional dedupeBy and action fields, you have full control over which object you want to create or update.
Also, the endpoint expects the name of the dedupe field under dedupeBy key, as opposed to dedupeFields. So the name is singular; you can provide a single field name use, and it does what you can expect: if the value in the field for a given record is not unique, an error will be returned for the individual record.

Marketo REST API - is there a way to get all records of a custom object?

I created a custom object and i want to get all its existing records. Is there a way of doing that via the REST API? Seems like a very basic and simple operation but i couldn't find information about it anywhere.
As you say, it seems like a basic task, but in the reality, it is more complex indeed.
Unfortunately, the Get Custom Object endpoint (which is the only endpoint to fetch Custom Objects) requires the filterType and filterValues parameters to be present as well. Basically this means that you have to have some information about the queried objects beforehand.
Also, a further restriction is that the value of filterType can only be one of the “searchable” fields of the Custom Object, meaning that it has to be either a Link field or a Dedupe field. (These fields are listed under the searchableFields property in the response from the Describe Custom Objects endpoint.)
So as mentioned above, you have to know the values for at least one of the properties of your Custom Objects before you make the query.
With additional queries though, you can grab these required values.
Let's say, you have your Custom Object linked to the Lead Object, and the Link field is called Owner Email (with the REST API name being ownerEmail) which links to the Email Address field of the Lead Object. In this case you could set the filterType to ownerEmail and set the emails of the leads as filterValues.
Then it is up to you how you gather the emails of those Leads who has a Custom Object attached. Luckily the REST API won’t throw an error if you provide a value that has no corresponding Custom Objects.
If your Custom Object is linked to a Lead, it's a bit complex but you can do like this:
Create a smart list and filter with "Has You Custom Object"
Get the smart list with API (GET /rest/asset/v1/smartLists.json)
Based on this list of Leads, get all Custom Objects (see the other answer).

What is the syntax to add a column to the Custom Form list that shows where in WF it is used?

Super simple.
When viewing the list of Custom Forms in Setup, I want to add a column that shows where those Custom Forms are in use (or null if used nowhere).
This is similar in principle to viewing the list of fields, which has a list of forms on which those fields are used.
What is the syntax I can use to add the appropriate column(s) to the view?
As far as I know, there is no linkage in the backend that connects categories (custom forms) to their host objects. This is probably because the list could be massive and the query would take quite a while to execute as it would have to traverse every object in Workfront or each form would store every parent object ID.
Unfortunately, you can't even search for objects by associated category IDs, so if you wanted to build this yourself you would need to query each object and search its categories to see if your custom form appeared.

How to deal with the choice "other" in EntityChoiceList in Symfony2 forms?

I've got a model as described below :
I've also got a form to create a new product with a field entity building a dropdown list containing all the Brands.
Now I want to add a value "Other" in this list in order to allow the user to specify the Brand manually in another text field.
The question is: is there a clean way to manage this case (eg. adding the value "Other" in the list, which is not an entity and get the form validation to work) with Symfony2 forms?
You can do it in two ways,
You can subscribe for FormEvents::BIND_CLIENT_DATA form event. In the event method you can create new Brand object from the text, save it and set the id to the form by calling $event->setData($data). See this cookbook entry.
OR
You can append a data transformer. In its reverseTransform method you can create+save the object and return its id. See this cookbook entry.

Resources