Pushing visitor data from DialogFlow to ZohoCRM - dialogflow-es

So I have connected DialogFlow to Zobot (Zoho Chatbot) and want to push information from DF to ZohoCRM.
My chatbot could sign someone up to a newsletter and once the person gives me their email I want to save that email and name in the ZohoCRM.
From what I can gather I have to use the DF webhooks to send information anywhere, I have found a sample code that can push data to the ZohoCRM but I want to customise it.
My main questions:
If I have a user email that is stored in DF as #sys.email how do I refer to this value in my web-hook code?
How do I specify what table and column the information must be stored in?
Where do I set my Zoho CRM ZSC Key?
This is code taken from the Zobot integration documentation page (https://help.zoho.com/portal/community/topic/schedule-a-call-and-push-visitor-data-to-zoho-crm-with-zobot-26-11-2018):
info crmdata;
if(!crmdata.isEmpty())
{ // update existing
_crmdata = crmdata.get(0);
info _crmdata;
leadid = _crmdata.get("id");
crmdata = zoho.crm.update("Leads",leadid,{"Full_Name":name},Map(),"your CRM connection name");
}
else
{
// create new lead
crmdata = zoho.crm.create("Leads",{"Email":email,"Full_Name":name},Map(),"your CRM connection name");
}
leadid = crmdata.get("id");
info leadid;

1.If I have a user email that is stored in DF as #sys.email how do I refer to this value in my web-hook code?
When user will be added to zoho crm you can start with workflow rule function which will be adding the variable you want to.
How do I specify what table and column the information must be stored in?
You can not specify table or column where the information must be stored in. You can only add new one user. I've tried it many times, sorry ;/

Related

Node JS Using AND or OR operator - Fetching data

Good Day!
I need help on the below issue:
Goal: is to filter data depending on the department content. What I'm trying to do is to fetch data from MongoDB based on your designation or department. For example, I'm from the Email Team:
I was able to fetch the data correctly using the below code:
return Announcement.find({ department: params.department }).collation({locale:'en',strength: 2}).sort({createdOn:1}).then(announcement => {
return announcement
})
However, what I'm trying to achieve is to get the data from the "All" department. For example, Email Team data plus the All data. This is a notification app. Wherein agents will receive or be notified if there are news recently published.
Example: As admin I have the option to assign a news to a specific department. I'm using a ComboBox for the selection: All, Email, Chat, Phone
So, if I selected All, since I'm from the email team, I should be getting the notification too.
After few minutes of research, I found this:
return Announcement.find({ $or: [{"department" : "All"},{department: params.department}]}).collation({locale:'en',strength: 2}).sort({createdOn:1}).then(announcement => {
return announcement
})

Microsoft PowerAutomate Flow Response ID

I'm using the template 'Send an email to responder when response submitted in Microsoft Forms'.
So when an entry is made in Forms, the data is written to a List, and the responder receives an email with some confirmation information.
It all works as expected, except for when I want to include the ID of the request.
I have a column called ID in my List, which gets auto-generated for each entry made (this is standard functionality, I haven't created this).
Back to my flow; when I add the Dynamic Content of "Response ID" (which seems to be the only "ID" available) it isn't quite right.
For example, I've just entered a test record. It was assigned ID = 71 in List. But when the Flow email was triggered, the Response ID included in the body of the email was = 66.
Screenshot of data in my List:
Screenshot of email received:
The response id is the id of the response to the Microsoft form.
If you want to save the response to SharePoint List, you could use create item action.Then you could get the new list item.
My test flow for your reference:
Test result:
Updated:

Using Graph API to query SharePoint list items and expand user field

I'm trying to query for some SP list items, all is working fine except I can't seem to expand a custom column of type Person.
I can see the createdBy and lastModifiedBy expanded and even includes the AAD user id, which is great and also leads me to think what I want is possible!
But mine is a custom column.
I'm running this and can only seem to get the SP user list id and the user's display name...neither of which are much use.
/items?expand=fields(select=UserLookupId,User)
Ideally I'd like to get the AAD user id as per createdBy and modifiedBy field, but the email would suffice.
Otherwise the only way I can see is to query the User Information List (using the UserLookupId) to get the email?
Thanks
This appears to be correct assumption:
Otherwise the only way I can see is to query the User Information List
(using the UserLookupId) to get the email?
for non-system user fields, it is indeed a way to go, but there are some distinctions whether user field is multi-valued or single-valued.
If Approvers is a multi-valued user field, then the following query:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$expand=fields($select=Approvers)
returns email and id properties along with displayName property for user field value.
While for single-valued user field only id (available via {userfield}LookupId property) and displayName properties could be requested via items endpoint, for example:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$expand=fields($select=Approver,ApproverLookupId)
So, indeed User Information List needs to be utilized to request additional user properties, for example:
https://graph.microsoft.com/v1.0/sites/root/lists('User Information List')/items/{item-id}/?$expand=fields($select=Email)
where item-id corresponds to user field lookup id
This was my experience modifying the
Build Angular single-page apps with Microsoft Graph. In the examples below, I changed my id's out with the default text.
Here is
The Finished Project on thier github
In Graph Explorer, this worked. You can verify it at the Microsoft Graph Explorer.
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?expand=fields($select=id,Title)
In the app/graph.service.ts in the app, this did not work. Even though you would expect it to based on the graph explorer.
.api('/sites/{site-id}/lists/{list-id}/items?fields($select=id,Title)')
Changing the app/graph.service.ts api call worked.
.api('/sites/{site-id}/lists/{list-id}/items?')
.expand('fields($select=id,Title)')
The result looked like this:
fields: {
#odata.etag: ""d6f5b6ea-9f90-452d-98ba-e838f58d3359,1"",
Title: "IT SPECIALIST (MID)",
id: "20"
}
Here's an example site id:
some.sharepoint.com,9dk062b-2e54-4e4f-b71a-cdb74f42cc44,c6cf6b0a-cc7c-41fd-a76a-ef8f97e8a22f
Here's an example list id.
8eg8c29a-5555-4cfc-bfa4-0e907488f781
The end url won't have any {} in it.

Workaround to search Netsuite Note record by Customer id

I'm trying to get an app I'm working on to display all associated user notes for a given Customer record (as it appears on the UI Customer record page in Netsuite proper).
To that end, I've set up a Netsuite RESTlet to return a list of internal ids for associated Note records given a Customer internal id.
I've set up a simple search in the RESTlet script:
function get_notes(params) {
log("GET params", JSON.stringify(params));
var filters = [
new nlobjSearchFilter('internalid', 'customer', 'is', params.id)
];
var columns = [
new nlobjSearchColumn('internalid'),
new nlobjSearchColumn('note'),
];
var search = nlapiCreateSearch('note', filters, columns);
var notes = search.runSearch().getResults(0, 3);
return notes;
}
function log(msg, details) {
nlapiLogExecution('DEBUG', msg, details);
}
The script works as expected, but the problem is that this search ONLY returns Notes for which the author field (which is a user internal id) matches the internal id of the user performing the search. Meaning - you can only search for Notes for which you are the author.
I have been informed that this is a 'feature' of Netsuite for some unfathomable security reason.
I need to be able to get a list of all the associated Note ids, not just those for which the user making the request is the author.
Any ideas on a workaround to get at all the associated Notes? A different way to structure the search? Some kind of secret way to define your own custom Search Joins?
I can't even find documentation on this behavior (blocking Note searches from non-authors). Perhaps someone knows how to override it at the admin level?
I'm not quite ready to admit that this is impossible yet.
NB: User Note is a Note-type record associated with the Customer record, not a field on Customer record, so I can't access it directly from Customer. There is also not a Search Filter or Search Join for Note or User Note.
Using RESTlets you cannot get the notes of other users unless you invoke the RESTlet using credentials/tokens of roles like Administrator/Full Access. RESTlets always runs in the context of current user.
One alternative to do that, if you really got to achieve this any how:
1) Create a user event script on customer which creates a custom record that simulates the functionality of system notes.
2) Make sure that the RESTlet user roles have full level of access on the custom record and make customer as parent of your custom record.
3) In your RESTlet return the custom records.
Basically RESTLETS always run as the user who invokes them.
If you can use a Suitelet for this you can set that up to run as Administrator and can return any Notes you can craft a search for.
Are you actually needing a Restlet ? i.e. Are you calling this from an external application or are you trying to add functionality in the NS GUI? If the latter then you can easily use a Suitelet.

Issue while inserting the user in liferay

I have created a form which has basic user details and on clinking of the Save button I am inserting the user details in the "USER_" table by calling the UserLocalServiceUtil.addUser(....). Now the user is creating with out any issue. But I am not able to see some form field parameters in UserLocalServiceUtil.addUser(....) method like (Title, Gender and Date Of Birth). Now how can I save this values. Please give me some suggestions that how can I insert the following fields (Title, Gender and Date Of Birth) at the time of user creation.
Liferay uses com.liferay.portal.model.Contact entity to store the contact information.
Use com.liferay.portal.service.ContactLocalServiceUtil.addContact method to create the contact. Significant parametres:
userId - Id of the user that is creating the contact. You can use PortalUtil.getUser method to get the current user from a request.
className - "com.liferay.portal.model.User".
classPK - Id of the new user that the contact is created for.

Resources