Capture text input and save it , dialogflow inline editor - editor

I have created a chatbot with dialogflow using the inline editor. It works perfect right now.
My problem is, how to capture the message entered by the user? ie:
Imagine I have this conversation:
user: Good morning
bot: Hi, how can I help you...
mu purpose is to get the text:
Good morning.
Then, I'll store this statement into my database.
I want just a method to capture it. Can you tell me what I should write, please?
Example: if I want to capture a parameter , I write:
let ville = agent.parameters.ville;
In case of the whole text, what should I write?

To get the full content of the message the user said, use:
let query = agent.query

Related

Access all fields in Zapier Code Step

Is it possible to access all the fields from a previous step as a collection like json rather than having to explicitly setting each one in the input data?
Hope the screenshot illustrates the idea:
https://www.screencast.com/t/TTSmUqz2auq
The idea is I have a step that lookup responses in a google form and I wish to parse the result to display all the Questions and Answer into an email.
Hope this is possible
Thanks
David here, from the Zapier Platform team. Unfortunately, what I believe you're describing right now isn't possible. Usually this works fine since users only map a few values. The worst case is when you want every value, which it sounds like you're facing. It would be cool to map all of them. I can pass that along to the team! In the meantime, you'll have to click everything you're going use in the code step.
If you really don't want to create a bunch of variables, but you could map them all into a single input and separate them with a separator like |, which (as long as it doesn't show up in the data), it's easy to split in the code step.
Hope that helps!
The simplest solution would be to create an additional field in the output object that is a JSON string of the output. In a Python code step, it would look like
import json
output = {'id': 123, 'hello': 'world'}
output['allfields'] = json.dumps(output)
or for returning a list
import json
output = [{'id': 123, 'hello': 'world'},{'id': 456, 'bye': 'world'}]
for x in output:
x['allfields'] = json.dumps(output[output.index(x)])
Now you have the individual value to use in steps as well as ALL the values to use in a code step (simply convert them from JSON). The same strategy holds for Javascript as well (I simply work in Python).
Zapier Result
Fields are accessible in an object called input_data by default. So a very simplistic way of grabbing a value (in Python) would be like:
my_variable = input_data['actual_field_name_from_previous_step']
This differs from explicitly naming the the field with Input Data (optional). Which as you know, is accessed like so:
my_variable = input['your_label_for_field_from_previous_step']
Here's the process description in Zapier docs.
Hope this helps.

Hubot display url as link in Slack

I'm using hubot with the hubot-slack adapter.
I have a very long url that I'd like to write to the chatroom, and would like to display it as a link.
From this:
http://magnum-ci.oak.domain.com:8080/job/nick_test_success_build/44/console
To this:
Click here to view the console out
I'm using:
res.send "http://magnum-ci.oak.domain.com:8080/job/nick_test_success_build/44/console|link"
I haven't tried this recently with Hubot, but note that it doesn't work as a user.
Slack's docs make it look like you can use "labels" to display friendly URL names. See the last example on this page https://api.slack.com/docs/unfurling
You may be able to send the text
<http://mylink.com|Show this>
in a message and get the desired results.
I tried this a long time ago and don't remember if it worked.
#mshish is right, <http://mylink.com|Show this> should be the way to go.
You can test the output of your link using the Message Builder.
Unfortunately it looks like this is not currently supported by the hubot.
https://github.com/slackhq/hubot-slack/issues/114

How to print a form in vb6.0

i use below code..but it doesn't print whole form.Its only print half form.how to print whole form?
PrintForm1.PrintAction = PrintAction.PrintToPreview
PrintForm1.Print()
i also use below code but its not working
If PrintDialog1.ShowDialog = DialogResult.OK Then
PrintDocument1.Print()
As Suzy mentions, PrintForm will send the entire contents of your form to the printer, if that's what you want. It's a lot like taking a screen shot of your form and sending it to the printer. If you want something more discriminating, you'll need to use some sort of reporting software.
However, if you got PrintAction to work at all, you're not using VB 6.0, so this might not be your answer.

Extraction from string - Ruby

I have a string. That string is a html code and it serves as a teaser for the blog posts I am creating. The whole html code (teaser) is stored in a field in the database.
My goal: I'd like to make that when a user (facebook like social button) likes certain blog post, right data is displayed on his news feeds. In order to do that I need to extract from the teaser in the first occurrence of an image an image path inside src="i-m-a-g-e--p-a-t-h". I succeeded when a user puts only one image in teaser, but if he accidentally puts two images or more the whole thing craches.
Furthermore, for description field I need to extract text inside the first occurrence inside <p> tag. The problem is also that a user can put an image inside the first tag.
I would very much appreciate if an expert could help me resolve this what's been bugging me for days.
Text string with a regular expression for extracting src can be found here: http://rubular.com/r/gajzivoBSf
Thanks!
Don't try to parse HTML by yourself. Let the professionals do it.
require 'nokogiri'
frag = Nokogiri::HTML.fragment( your_html_string )
first_img_src = frag.at_css('img')['src']
first_p_text = frag.at_css('p').text

Howto I get the user domain\username and Display name From SharePoint People Picker InternalId?

I have been trying to user sharepoint designer to retrieve the user's full name and even the domain\username from the people pucker field but the problem is I tend to get numbers. It looks like the intetrnal Id. In my case I am getting 14 instead of domain\username from the list form's field.
Any idea on where I can get the dmain\username or even better the full name?
Thanks !!
I am using SharePoint Designer and Windows Sharepoint Services 3/SharePoint 2007.
Update :
I have managed to get the domain\username now. I just had to change the people picker's show field to ID. However now I am getting a weird prefix on my domain\username. I am getting this -1;#domain\username instead of just domain\username. Anybody know how I can overcome this?
Thanks !!
I don't know how to avoid getting the information in that format, but I know how to get rid of the "1;#" part.
Assuming the variable "theName" contains "1;#domain\username", then you can do:
Dim poundSignIndex As Integer = theName.IndexOf("#") + 1
theName = theName.Substring(poundSignIndex)
That will remove everything before the "domain\username" part of the string.
Leon.

Resources