Salesforce - Edit polymorphic lookup by id - salesforce

I need update polymorphic lookup field by id. I use Bulk API v48.0. If I upload data to job (for example, for updating Event object)
id,Lead:Who.Id
00U5f000008eventId,00Q5f000003ISwhoId
then event is not updated and API return job status
{
"id": "7505f000002pnjobId",
"operation": "upsert",
"object": "Event",
"createdById": "0055f0000032userId",
"createdDate": "2021-12-08T11:06:29.000+0000",
"systemModstamp": "2021-12-08T11:06:51.000+0000",
"state": "JobComplete",
"externalIdFieldName": "Id",
"concurrencyMode": "Parallel",
"contentType": "CSV",
"apiVersion": 48.0,
"jobType": "V2Ingest",
"lineEnding": "LF",
"columnDelimiter": "COMMA",
"numberRecordsProcessed": 1,
"numberRecordsFailed": 1,
"retries": 0,
"totalProcessingTime": 62,
"apiActiveProcessingTime": 3,
"apexProcessingTime": 0
}
If I fill email instead id
id,Lead:Who.Email
00U5f000008eventId,test#mail.com
then event is successfully updated.
How can I update polymorphic lookup value by object id?

When you're updating the value of the lookup field itself, you don't need to use the polymorphic relationship syntax. Simply refer to the field by its name, WhoId:
Id,WhoId

Related

Get member emails when using delta on group

I'm trying to use the graph API to get a list of users which have been added to a specific group using the delta feature so I reduce the amount of data that passes through.
However, when I $expand on the members property, I'm only getting the id, and not the specific properties I need (mail and some other details) - despite the fact I'm $selecting it.
The url I'm using for the query is
https://graph.microsoft.com/v1.0/groups/delta?$expand=members($select=id,mail)&$select=members&$filter=id eq '<myGroupId>'
And the data I'm getting returned is:
[...]
"value": [
{
"id": "xxxxx-xxxx-xxx-xxx-xxxxx",
"members#delta": [
{
"#odata.type": "#microsoft.graph.user",
"id": "xxxxxxxxxxxxxxxxxxxx"
},
{
"#odata.type": "#microsoft.graph.user",
"id": "xxxxxxxxxxxxxxxxxxxxx"
},
I want my members#delta to include the details of the member so I don't have to query for them seperately.
According this members#delta property contains only the ids of member objects in the group.

Solr: using the labelled relationship for nested documents throws unknown field error

Using the example document that Solr has:
{
"ID": "1",
"title": "Solr adds block join support",
"content_type": "parentDocument",
"comments": [{
"ID": "2",
"content": "SolrCloud supports it too!"
},
{
"ID": "3",
"content": "New filter syntax"
}
]
},
When I try to index this json, it would give this error: "ERROR: [doc=1] unknown field 'comments.ID'" even though the field ID is defined in the schema (of course, comments.ID is not)
I am trying to use the labelled relationship and not the anonymous relationship using _childDocuments_ because that is what the docs recommends. What am I missing?
If you're trying to send this to the /update/json/docs convenience path, it will likely fail with a nested document.
Try instead to send your document to the /update path, and use the JSON command structure shown here https://solr.apache.org/guide/8_11/uploading-data-with-index-handlers.html#sending-json-update-commands
Basically, send to /update and wrap your document in an
{
"add": {
"doc": {<your document here>}
}
}
Be sure to also set the content type to application/json

Apache Flink: REST API retrieve metric values

I started Latency tracking and passed the /jobs/metrics of the REST API. Obtained the following information:
{"id":"latency.source_id.cbc357ccb763df2852fee8c4fc7d55f2.operator_id.e5ebb093256018a0621f548fbe118f8a.operator_subtask_index.0.latency_p75"},
{"id":"lastCheckpointExternalPath"}, {"id":"latency.source_id.cbc357ccb763df2852fee8c4fc7d55f2.operator_id.55785f9edccd37ac9093dea77018f09d.operator_subtask_index.0.latency_max"}, {"id":"latency.source_id.cbc357ccb763df2852fee8c4fc7d55f2.operator_id.55785f9edccd37ac9093dea77018f09d.operator_subtask_index.0.latency_p999"},
.....
Q: Why aren't the specific values displayed? How should I use the API correctly?
Thank you for your help.
See the doc.
/jobs/metrics return the metrics' id, you need query with job id and metric id:
GET taskmanagers/ABCDE/metrics?get=metric1,metric2
to get values like:
[
{
"id": "metric1",
"value": "34"
},
{
"id": "metric2",
"value": "2"
}
]

How to store Dictionary values in the database in the django restframework

Which field i want to use in the django Restframework so that i can store the data in DB the way i specified below. I am Using Django rest framework and djongo engine[MongoDB] to store it in the Database. I used ArrayModelField which doesn't match my expectation
"taxon": {
"id": 11,
"name": "Rails",
"pretty_name": "Brand -\u003e Rails",
"permalink": "brand/rails",
"parent_id": 2,
"taxonomy_id": 2,
"taxons": []
}

custom property in LRS & Tincan API

is it possible to add custom property to "Actor" via Tincan API to save it
in LRS.
Detail:
i am using Learning Locker as LRS system & Tincan API of Drupal & as its known there are 3 object inside the statement record that is saved in LRS which are [Actor - Verb - Object]
now the Actor has 2 properties which are [name - mbox]
and i tried to modify the Tincan module to add custom property which is [country] but the LRS API "Learning Locker" refused it.
so is there a custom way to additional properties so that i can filter with later like [age - gender - country] or its standard API strict on the defined attributes
{
"version": "1.0.0",
"actor": {
"objectType": "Agent",
"name": "Creative User",
"mbox": "mailto:register#example.com"
},
"verb": {
"id": "http://adlnet.gov/expapi/verbs/action_custom_verb",
"display": {
"en-US": "action_custom_verb"
}
},
"object": {
"objectType": "Activity",
"id": "http://localhost",
"definition": {
"name": {
"en-US": "master"
}
}
},
"authority": {
"objectType": "Agent",
"name": "drupaladmin",
"mbox": "mailto:hello#learninglocker.net"
},
"stored": "2017-02-06T16:58:23.625600+00:00",
"timestamp": "2017-02-06T16:58:23.625600+00:00",
"id": "9c1d552b-c825-4403-9c89-a9381b8d5320"
}
The standard API is strict with respect to the addition of properties. And the Agent/Group objects (which are what actor can contain) do not include the ability to expand their scope.
Additional data points can be added in special properties called extensions that are available in a couple of places in the statement's objects. In this case you could use extensions in the context property's value to include your additional information about the actor. You could do this as single discrete pieces of information where each has its own extensions key, or you could use a single key that uses an object as its value and include individual pieces of information in properties of that object. For more information about extensions see: http://tincanapi.com/deep-dive-extensions/
Note that extensions keys are not filterable via the /statements stream resource, so any querying based off of their key or value will have to be done through other means than the specification's API.

Resources