How to define multiple wit/datetime from one sentence in wit.ai? - wit.ai

I am trying to define multiple wit/datetime from one sentence in wit.ai, but the UI doesn't seem to allow it.
When entering "Do this on Nov 25th, do that on Dec 23rd, and do that on Jan 21st.", and then adding a entity as wit/datetime, it detects Nov 25th.
But then when I try to add a second entity as wit/datetime, it replaces the previous one and doesn't allow me to add it as a new separate wit/datetime.
Any help is much appreciated :-)
Thanks!

you should use the role, when you need to separate same entities like location or datetime...
highlight the first datetime in your phrase, choose wit/datetime then click on the small radio button next to it and name the role for this entity.
ex: datetime:startTime
do the same for the next entity and name it: datetime:endtime for ex.

Not sure how you add the second entity but you should be able to highlight multiple spans as shown here

Related

Show content based on whether the user has certain tag in Mailchimp

I went through the Merge Tags here and here, but couldn't figure out the syntax that would allow me to show content based on whether the user has certain Tag or not.
Help?
My goal in case it helps:
User subscribes, and is queued for a welcome mail one day later. In meantime that user may get tagged (my way of segmenting them), and so, the next day when that user receives the welcome mail, the content needs to be catered based on the tag that user got.
Got a response from their support saying
merge tags do not work with Tags just yet
here's the whole thing:
While we do have conditional merge tags available, I'm afraid we do
not have any that would work with Tags. To be transparent, Tags were
recently added a few months ago, and there are some features in our
application that has not updated to work with Tags just yet.
Because conditional merge tags do not work with tags yet, the best
option would be to create multiple automations and send them out based
on each tags. If you do it that way, you'll be able to target those in
specific tags with specific content
Dug a little deeper from the first link. There is another link Use Conditional Merge Tag Blocks which contained the below code:
Name
IF-ELSE
Definition
Use ELSE to indicate alternative content to display if the *|MERGE|* tag value is false.
Example
*|IF:MERGE|* content to display *|ELSE:|* alternative content to display *|END:IF|*
Name
ELSEIF
Definition
Use ELSEIF to specify a new *|MERGE|* tag to be matched against if the first *|MERGE|* tag value is false.
Example
*|IF:TRANSACTIONS >= 20|* Enjoy this 40% off coupon! *|COUPON40|*
*|ELSEIF:TRANSACTIONS >= 10|* Enjoy this 20% off coupon! *|COUPON20|*
*|ELSE:|* Enjoy this 10% off coupon! *|COUPON10|* *|END:IF|*
More examples with definitions can be found here.
Hope this is the answer you were after.

Modifying Domain of Many2One using Many2Many

Just to preface, I'm using Odoo 10 Enterprise.
I have a custom module with the following (these are just the relevant fields) on its form:
orange_tag_id = This is a Many2Many field with the _Checkboxes widget defined that's connected to a Tags module (we'll just call it orange.tags). This field displays six or seven tags I've created and then applied to various products within the 'product.product/template' module.
orange_child_ids = This is just a One2Many within a child module of the parent module. This lists a product_tmpl_id Many2One and then a read-only copy of orange_tag_id from the parent that just copies whatever is selected in orange_tag_id in the parent form (this was created just in case defining parent.orange_tag_id in the domain didn't work).
When a tag is selected from the orange_tag_id checkbox, it should sort of modify the domain of product_tmpl_id in orange_child_ids and then only display the products in the drop-down display that have been tagged with the selected active tag. I've managed to get this sort of working by just adding the following to the form XML view within orange_child_ids:
<field name="product_tmpl_id" domain="[('orange_tag_id.id','in',parent.orange_tag_id[0])]"/>
This will display only the products that have been tagged with the selected tag with one exception: Tag6's products (just calling it this because its ID was 6) will always display in the drop-down regardless of whether it's selected or not. If Tag2 is selected, then Tag2 and Tag6's products will display. I tried removing Tag6 from any products that had it defined, then deleting the Tag6 record, re-creating the tag, and re-applying it to the relevant products, but the issue persists. I also can only select one tag in the checkbox -- if more than one is selected, I get the following error from product_tmpl_id:
TypeError: not all arguments converted during string formatting
This isn't as big of a deal as not having the correct records displaying, but I'd also like to resolve this, but I'm not entirely sure how.
I've searched for hours and am aware of methods where this can be done in self-hosted installations, however, we're using Odoo 10 Enterprise (I've omitted the required x_ in my aforementioned custom fields just for easier readability), and I have no access to the file system and consequently can't make modifications where that's required. I've been trying to figure this out using just the Developer Tools and my administrative access to the database's settings.
I've messed around a lot with the domain, looked through many questions and forum threads, and what I have was the only thing that worked. Is there any way to get this working correctly within the limitations of Enterprise?
Much obliged.
It appears that adding [2] after the [0] makes everything work and resolves the two issues I was having, so:
<field name="product_tmpl_id" domain="[('orange_tag_id.id','in',parent.orange_tag_id[0][2])]"/>
This will filter the results of the Many2One based on the records selected in the Many2Many field.
While [('orange_tag_id.id','in',parent.orange_tag_id[0][2])] will work, it is extremely obscure.
I advise you to go with [('orange_tag_id.id','in',parent.orange_tag_id.ids)]

#Dblookup and formatting on web

I have been developing a web application using domino, therein I have dblookup-ing the field from notes client; Now, this is working fine but the format of value is missing while using on web.
For example in lotus notes client the field value format is as above
I am one, I am two, I am one , I am two, labbblallalalalalalalalalalalalalalalalalalaallllal
Labbbaalalalallalalalalalaalallaal
Hello there, labblalalallalalalllaalalalalalalalalalalalalalalalalalalalalalalala
Now when I retrieve the value of the field on web it seems it takes 2 immediate after 1. and so forth, I was expecting line feed here which is not happening.
The field above is multi valued field. Also on web I have used computed text which does db lookup from notes client.
Please help me what else could/alternate solution for this case.
Thanks
HD
Your multi-valued field has display options associated with it and the Notes client honors those. Obviously, your options are set up to display entries separated by newlines.
The computed text that you are using for the web does not have options like that and the field options are irrelevant because you aren't displaying the field. Your code has to insert the #Newlines. That's pretty easy because #DbLookup returns a list, and if you concatenate a list and a scalar, the scalar will be appended to each element of the list. (Look at the third example under "concatenation, pairwise" here to see what I mean.
The way you've worded your question is a little unclear to me, but what you need in your computed text formula is either something like this:
list := #DbLookup(etc,. etc.);
list + #Newline;
Or something like this:
multiValueFieldContainingListWithDbLookupResult + #NewLine;
I used #implode(Dblookupreturnedvalue;"");
thanks All :)

Filter lookup inside a Dialog- CRM 2015 Online

How can we filter a lookup that is in a page of the dialog process.
E.g. I have a lookup to "incident" on Prompt and Response, I would like to filter it based on the value of a field in incident entity.
I tried:
Creating new views, also setting it as default.
addPreSearch and addCustomFilter on the field on the form(Not sure how to use these scripts inside the Dialog)
Any Ideas ?
Thanks you
Unfortunately this is not possible.
As an alternative you could consider adding a query to the dialog and a page with a prompt having an Option Set (picklist) response type.

SharePoint Workflow Error: "Unable to transform the input lookup data into the requested type" BUT only on New Item Creation

FYI to start, I am aware of how to properly set up an update to a lookup, and am 99% positive I've done this correctly.
I know this because When I set the workflow to automatically start when an Item is Changed, then it works perfectly. But when I simply change this setting so it will automatically start on New Item Creation, it Cancels the workflow and I get a "Coercion Failed: Unable to transform the input lookup data into the requested type." If both options are checked then it fails on creation, but simply clicking edit on the item properties, and the "Save" makes it work.
The workflow is on a Document Library and works as follows;
User selects the Work Task LookUp from a dropdown in the edit properties form after uploading, and then Saves the item (adding it to the document library). The workflow is suppose to then look at the Work Task LookUp selected, and pull the Account and Effective Date-Type lookUp ID's that Work Task item has, and sets the Document's identical fields to the same value.
Here is the code for the workflow if it helps;
If Current Item: Parent Task is not empty
If Current Item: Sub Task is not empty
Log Both are empty to workflow history list
Then Set Account to Work Tasks:Account
The Log Set Account to workflow history list
Then Set Effective Date and Type to WorkTasks: Effective Date and Type
The Log Set EffDateType to the workflow history list
This is all done in one step. I also added additional steps to test if the account and effective date type fields have been set properly, and if not to set them again. But everytime I run the workflow on change and it works, it always correctly sets these fields based upon the first Step (posted above) and the additional check logs to the history that they are not needed.
As an example, The lookUp for Integer for Tasks:Account is set to work as follows;
Date Source: Work Tasks (a list)
Field from Source: Account (a lookup)
Return Field as: Lookup ID (as Integer)
Find the List Item
Field: Title (from the Work Tasks list)
Value: Current Item: Parent Task (Which is a look up of the "Title"
Field from Work Tasks List, and is set to return the Value as a LookUp Value (As Text))
The Effective Date and Type setting is pretty much identical.
So anyone have any insight? I've tried running it as an impersonated Step, setting a workflow pause (for 1 minute), changing the lookup types incase I messed it up to start with, but ultimately the above workflow DOES work, but only when I set it to "Automatically start on the Change (edit) of an Item", NOT "Automatically start on New Item Creation" like I need to to do.
Oh yes, fyi, I am using SPServices CascadingDropDown on the Work Task and Sub Task fields of the doc Library form, but I honestly do not believe this has anything to do with my issue.
UPDATE:
I've talked with another developer, and he believes it is due to the issue that the workflow is occuring too quickly, before the item creates an ID for itself, which it needs to conduct the lookUps. He had me add another "Pause Workflow" to the very top of my workflow code (above the If conditions) and set it for 1 minute.
It then worked properly.
Downside is we want this to labeling to occur as close to item creation as possible. Because a view of the library relies on grouping based upon Account and Effective Date and Type. To add to this downer, Microsoft's Pause Workflow only allows for 1 minute or more, and then the timer used for this is often off, resulting in a pause longer than that. So far, every test is currently showing 2 minutes minimum on the pause.
A possible alternative solution for instantaniously populate the fileds is to use Javascript and SPServices to do the lookUp to the Task list to pull the account and effective date - type fields and then populate, but my Javascript is not very strong and I would need help doing this. If anyone has any suggestions, I would appreciate them.
(Answered in a question edit. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
I don't know if it is the ID for the item after further testing. I changed the start of the workflow to wait until a field in the item changes. I set it to wait until the ID field is not 0 (since you cannot set to null), and it still does not work.
6/14/2012 4:13 PM Comment System Account Waiting on ID ​
6/14/2012 4:13 PM Comment System Account Waiting complete on ID ​
6/14/2012 4:13 PM Error System Account Coercion Failed: Unable to transform the input lookup data into the requested type.
I have tried other fields as well, like document ID value is not empty, and it will wait, log it finishing the wait, and then fail.
UPDATE This issue has something to do with the Parent Task field. I have solved the issue without having to wait for a period of time by setting the change from above to wait until the Parent Task field is not empty. It then completes the workflow fine.
Anyone know why there is a delay though? I've solved it, but still don't fully understand what takes it so long.
The main fault has been solved (hence the answer), and the remaining point about the reasons for the delay would probably be a discussion point or not specific enough for SO. Any further clarification can be edited in here.