How to get servicenow survey responses using api - servicenow

How can we get the servicenow survey questions and responses using API?
I need to get all the responses for a survey I created including the question, answer and the ticket number.
I tried to get the responses from asmt_metric_result table, got the string value only. How can I get the question and ticket number as well?

Related

Google People API: search contacts in a specific group and contacts updated after a specific time

I am migrating our code from Google Contacts API to Google People API as Google Contacts API will be deprecated soon, but I noticed new People APIs are simple to compare with the old Contacts API.
For example, we have below code use the old Contacts API to search in a specific contact Group and were updated after a specific date by passing in the Group and StartDate parameters, but now we can't do the same query with new People API.
My question is in the new People API, is there any way we can search contacts in a specific Group and only get contacts that were updated after a specific date?
I saw one question which uses syncToken, but I think it is not a good solution for us.
Option to get the contact entries updated after a specific time NOT given in Google People API
GData.Contacts.ContactsFeed feed = service.Query(
new GData.Contacts.ContactsQuery("https://www.google.com/m8/feeds/contacts/default/full/")
{
OAuthRequestorId = employeeUserEmail,
Group = [contact group url],
NumberToRetrieve = FetchSize,
StartIndex = 1,
StartDate = [a date that only get contacts were modified after it],
});
I think they intentionally moved away from using a timestamp approach (give me all contacts updated since 1/1/2021) to a SyncToken approach.
The SyncToken eliminates any race-condition that might lead to loss of data.
For example if a contact was updated while a query was already in progress this leads to a race condition whether that contact would be included in the next query or not, which might cause the data changes to not get synced and next sync would be overridden.
So in case you're doing a fresh sync, or haven't synced for over 7 days, just get all the contacts of a group via: contactGroups.get.
If the last sync was less then 7 days ago, use a sync token to get just the updated contacts.
You could potentially get all contacts of a group, and then run a loop that filters via sources.updateTime but again, you're risking data loss.

Place Details API intermittently not returning all fields

I am currently making a REST call to the place details api for the rating and review fields. A smaller percentage of requests are coming back with only the rating returned and not the review field. In those cases still getting a 200.
Reviewed examples of these businesses in google and verified they do have reviews. Most recent example had 22. Verified it was the same place id.
My only other thought was maybe a quota issue, however I dont believe I am reaching 100 per second and would generally receive a different status back.

Populate contact and opportunity lookup in Survey Response

I created a survey in Voice of the Customer app. I included piped data as below :
I created a workflow to send an email when an opportunity is won:
I am able to see the piped data in the survey. But, the contact lookup and opportunity lookup is not getting populated in the survey response form :
Am I missing something?
How does these lookups get populated?
You can do a similar workflow (or pre create/post create plugin) on create of survey response, to map the opportunity lookup value from survey in survey response as well.
When we send an email containing the survey, a survey activity is formed. This survey activity has a unique invitation link, regarding field (populated with opportunity in my case) and is tied to the survey.
When I submit the response, the survey response gets tied to this survey activity. Hence, we are able to tag survey responses with different opportunity records.

CRM Dynamics - Voice of the Customer (VoC) survey - Update Standard/Custom entities based on Survey Responses?

Is it possible to update standard and/or custom entities based on responses provided from a Dynamics CRM Voice of the Customer (VoC) survey?
According to Joel Lindstrom in this blog, this is possible (at least for the Contact entity) via a workflow, but it doesn't actually show how to update a field on the contact entity.
Notes:
When I tried creating a workflow (as described in the link):
I added an Update step, but the Contact entity wasn't available from the list of entities to update.
I then added an Insert step and the contact entity was available. (I don't count this as an acceptable option, because I want to update a record. I don't want a second record.)
If your workflow (W1) is on child Question response (QR), no direct Contact relationship is available. Only available on parent Survey Response (SR).
So you need a new Contact relationship in QR and another workflow (W2) to update this QR contact from SR. Then the W1 can be used to update the Contact fields like Phone # from one of the Survey Question response.
The blog post clearly says:
The first challenge we are going to hit is that since the answer doesn’t have a direct relationship with contact, we can’t easily update the Contact record from a question response workflow. One way to resolve this is to add a relationship between question response and contact, and if the response is related to a contact, update the contact field on the question response to link it to the contact.

What data structure is used to implement facebook like's post and comments? [duplicate]

This question already has answers here:
Facebook "like" data structure
(4 answers)
Closed 9 years ago.
This is one of my java interview questions...
I was asked which data structure would you use to implement Facebook post, like and comments?
I would love to hear the view of all the members....
This is really more a task for a database (notice how complex the below is, compared to this (because all of the below is taken care of with a proper database with proper indexing)), but...
Note I'm assuming only posts can be liked and comments are for a post.
Posts:
Posts can probably be a Map of post ID to post object.
If you want to see a list of posts a user made, you'll also need a Map of user ID to a Set of post IDs.
Likes:
You want to quickly get the number of likes per post and see whether a user liked a post, so a Map of post ID to a Set of user IDs of those who like it.
If you also want to quickly see which things a user likes, you'll need a another data structure - a Map of user ID to a Set of post IDs liked.
Comments:
Comments can probably be a Map of comment ID to comment object. The connected post ID will be stored in the comment object.
You want to quickly get the comments per post, so a Map of post ID to a Set of comment IDs.
If you also want to quickly see a list of comments made by a user, you'll need a another data structure - a Map of user ID to a Set of comment IDs.

Resources