i'm working on a alexa skill and have some problems with the setting of default values for slots during an dialog model.
I have an intent with 4 slots and i want to give 2 of them at default values at the bedinning. This is my code to try this:
i created an intent object and set the values.
updatedIntent = {
"name": "Training",
"confirmationStatus": "NONE",
"slots": {
"slot1": {
"name": "slot1",
"value": "", /// HERE I ADDED "" BECAUSE THIS VALUE SHOULD BE FILLED BY THE USER
"resolutions": {
"resolutionsPerAuthority": [
{
"authority": "",
"status": {
"code": "ER_SUCCESS_MATCH"
},
"values": [
{
"value": {
"name": "Pferde",
"id": "e036baff329d97ae8387f195b27fe9af"
}
}
]
}
]
},
"confirmationStatus": "NONE"
},
"slot2": {
"name": "slot2",
"value": "test", //HERE FOR SLOT2 I ADDED MY DEFAULT VALUE "TEST"
"resolutions": {
"resolutionsPerAuthority": [
{
"authority": "",
"status": {
"code": "ER_SUCCESS_MATCH"
},
"values": [
{
"value": {
"name": "Fische",
"id": "4adf750f60e18ab47f596aeb5b838733"
}
}
]
}
]
},
after that i returned the updatedIntent via :delegate.
this.emit( this.emit(':delegate', updatedIntent));
Soo now slo2 is filled an Alexa does not ask me for that. But slot1 is not filled (only with "") so alexa asks me "Give me the value of slot1?" and i give the answer "test". The Input Intent is now filled with slot1=test. But it does not overwrites the "" in the output Intent. So Alexa asks me again "Give me the value of slot1?". And no matter what i say it does not fill the slot1. It ends in a loop.
What do i wrong? Maybe the syntax is wrong? or do i have to asign the input intent opject to updatedIntent?
Thank you for your help.
I don't understand why setting the value of slot1 to an empty string. If your intention is to set the default value of slot1 to nothing then you don't have to do anything, that's what you get by default. When a slot value is not set the "value" property does not exist in the slot. It only exists if there's a (non empty) value:
"slots": {
"marca": {
"name": "marca",
"confirmationStatus": "NONE"
},
"precio": {
"name": "precio",
"confirmationStatus": "NONE"
},
"color": {
"name": "color",
"value": "roja",
"confirmationStatus": "NONE"
},
"talla": {
"name": "talla",
"value": "grande",
"confirmationStatus": "NONE"
}
}
Related
Hi I want to set the Note field as part of my PUT request when adding a new activity record in Advanced.
I have my custom endpoint setup and I can insert the activity record no worries except setting the Note system field doesnt seem to do anything?
Here is an example of my JSON for the request
{
"Note": "narrtion test five",
"Summary": {
"value": "Test Task Status"
},
"Type": {
"value": "W"
},
"ActivityDate": {
"value": "2020-03-04T00:00:00"
},
"StartTime": {
"value": "0001-01-01T15:00:00"
},
"Owner": {
"value": "MATTMCD"
},
"Status": {
"value": "Completed"
},
"CostCode": {
"value": "0000"
},
"EarningType": {
"value": "RG"
},
"Billable": {
"value": true
},
"LabourItem": {
"value": "LABOUR-MAT"
},
"Project": {
"value": "PR00000001"
},
"ProjectTask": {
"value": "TESTTASK"
},
"TimeSpent": {
"value": "0:30"
},
"ActivityDetails": {
"value": "narrtion test five"
}
}
Would appreciate some help with this?
Can you try with "note" instead of "Note" ?
{
"note": "narrtion test five",
...
}
Automating creation of Sales Invoice via Rest API
Unable to get CustomerLocation to populate
In the WebService EndPoint the Mapped Object and Mapped Fields are blank for this item
Has any one successfully used this API to modify Location?
Does any one know if I have a formatting error in my JSON for Linked Entities, it matches the documentation but may not be up to date?
Tried several formats of JSON based on the guide and experience including Linked, Summary, Custom and Detail
Tried both BillToSettings and BillingSetting Entities
Searched Known issues, Newton JSon
"Type": { "value": "Invoice" },
"CustomerID": { "value": "C0004055" },
/// bit does not create in Acumatica
"BillToSettings": { "CustomerLocation": { "value": "67217" } },
/// "BillingSettings" : {"CustomerLocation" : {"value" : "67217"}
/// also LocationID, CustomerLocationID and many combinations there of
"CustomerOrder": { "value": 1942 },
"Date": { "value": "2/14/2019" },
"Description": { "value": "SO S048773" },
"Details": [
{
"InventoryID": { "value": "POLLING-HOSTING" },
"TransactionDescr": { "value": "GPRS Monitoring" },
"UOM": { "value": "PNTS" },
"Qty": { "value": "3" },
"UnitPrice": { "value": "68.25" }
},
{
"InventoryID": { "value": "AIRTIME" },
"TransactionDescr": { "value": "GPRS Airtime" },
"UOM": { "value": "EACH" },
"Qty": { "value": "3" },
"UnitPrice": { "value": "20" }
}
]
I expect the Default MAIN location to be overridden with 67217 instead every record shows main
If I add the address Override fields (as below) then I get data for them on the successful creation of the invoice but no CustomerLocation data is returned.
Nor does the LocationID update correctly
BillingSettings = new
{
BillToAddressOverride = new {value = true},
BillToContactOverride = new { value = true },
CustomerLocation = new { value = "67217"}
},
I tried to use your JSON example on a clean SalesDemo install of 2019R1 and could replicate the same issue that you're experiencing.
I think it has to do with the CustomerLocation field not being mapped in the Default 18.200.001 endpoint. It actually makes sense if we look at the response object - there is no CustomerLocation field in the response either.
First Attempt, without extending the API endpoint:
{
"Type": {
"value": "Invoice"
},
"CustomerID": {
"value": "ABARTENDE"
},
"Date": {
"value": "5/10/2019"
},
"Description": {
"value": "Test SalesInvoice Creation"
},
"BillingSettings" : {
"CustomerLocation" : {
"value" : "VEGAS"
}
}
}
Response from the first attempt:
"BillingSettings": {
"BillToAddress": {
"AddressLine1": {
"value": "201 Lower Notch Rd"
},
"AddressLine2": {},
"City": {
"value": "Little Falls"
},
"Country": {
"value": "US"
},
"PostalCode": {
"value": "07424"
},
"State": {
"value": "NJ"
}
},
"BillToAddressOverride": {
"value": false
},
"BillToContact": {
"Attention": {
"value": "Accounts Receivable"
},
"BusinessName": {
"value": "USA Bartending School"
},
"Email": {
"value": "barkeep#usabartend.con"
},
"Phone1": {
"value": "+1 (908) 532-9522"
}
},
"BillToContactOverride": {
"value": false
}
}
If you extend the endpoint and implement the Location field which can be found under the Invoice Summary selection when populating the field, you should be able to achieve your intended outcome. PS. I added the Location on the SalesInvoice object itself, and not on the BillingSettings object:
Second Request, the extended endpoint includes the Location field that was added:
{
"Type": {
"value": "Invoice"
},
"CustomerID": {
"value": "ABARTENDE"
},
"Date": {
"value": "5/10/2019"
},
"Description": {
"value": "Test SalesInvoice Creation"
},
"Location" : {
"value" : "VEGAS"
}
}
Second Response:
{
"Amount": {
"value": 0
},
"Balance": {
"value": 0
},
"BillingSettings": {
"BillToAddressOverride": {
"value": false
},
"BillToContactOverride": {
"value": false
}
},
"Currency": {
"value": "USD"
},
"CustomerID": {
"value": "ABARTENDE"
},
"Date": {
"value": "2019-05-10T00:00:00+00:00"
},
"Description": {
"value": "Test SalesInvoice Creation"
},
"DueDate": {
"value": "2019-06-09T00:00:00+02:00"
},
"Hold": {
"value": false
},
"Location": {
"value": "VEGAS"
},
"ReferenceNbr": {
"value": "AR006994"
},
"Status": {
"value": "Balanced"
},
"Type": {
"value": "Invoice"
}
}
As to whether the CustomerLocation holds any meaningful value/purpose, I'm not sure, so I left it in the BillingSettings as is.
This is the interaction model I am using:
{
"interactionModel": {
"languageModel": {
"invocationName": "greeter",
"intents": [
{
"name": "HelloWorldIntent",
"slots": [
{
"name": "phrase",
"type": "phrase"
}
],
"samples": [
"{phrase}"
]
}
],
"types": [
{
"name": "phrase",
"values": [
{
"name": {
"value": "HelloWorldIntent asdf {phrase}"
}
}
]
}
]
}
}
}
Notice the value of phrase slot type. When I set it this way, whatever I say to alexa, whole of the raw query is getting populated in value field of phrase slot of the request object.
Ex:
"Launch greeter" ==> LaunchIntent (obvious)
"No matter what I say it triggers Hello world intent" ==>
"intent": {
"name": "HelloWorldIntent",
"confirmationStatus": "NONE",
"slots": {
"phrase": {
"name": "phrase",
"value": "no matter what I say it triggers hello world intent",
"resolutions": {
"resolutionsPerAuthority": [
{
"authority": "amzn1.er-authority.echo-sdk.amzn1.ask.skill.6c1d0991-f895-45fa-ba37-6880d3cc95f1.phrase",
"status": {
"code": "ER_SUCCESS_NO_MATCH"
}
}
]
},
"confirmationStatus": "NONE"
}
}
}
I am not able to figure out how this interaction model is giving me the raw query in "value" field of phrase slot.
I have a frustrating issue with the type set as input I cant see the label. Its works fine if I use type as select. This is my code:
{
"type": "input",
"key": "firstName",
"templateOptions": {
"type": "text",
"placeholder": "jane doe",
"label": "First name"
}
},
that doesn't show the label but this does:
{
"key": "transportation",
"type": "select",
"templateOptions": {
"label": "How do you get around in the city",
"valueProp": "name",
"options": [
{
"name": "Car"
},
{
"name": "Helicopter"
}
]
}
}
Any help would be appreciated ?
I have multiple parameters that I want to reference, but I do not want to specify them one by one.
This snippet does not make the parameters show up:
{
...
"paths": {
"/stuff": {
"get": {
"description": "Gets stuff",
"operationId": "getStuff",
"parameters": {
"$ref": "#/definitions/set1"
}
}
}
},
"parameters": {
"a": {
"name": "a",
"in": "query",
"description": "Param A",
"required": false,
"type": "string"
},
"b": {
"name": "b",
"in": "query",
"description": "Param B",
"required": false,
"type": "string"
}
},
"definitions": {
"set1": [
{
"$ref": "#/parameters/a"
},
{
"$ref": "#/parameters/b"
}
],
"set2": ...
}
}
Is this possible or do I have to specify each parameter like set1, for each request?
Indeed that's not a valid definition and as you suggested, you'd have to specify each parameter separately by referencing the global one. If your parameters are shared for all operations under a specific path, you can define those at the path level and they would be applied to all operations.
For an individual operation, you'd define it as:
"paths": {
"/stuff": {
"get": {
"description": "Gets stuff",
"operationId": "getStuff",
"parameters": [
{
"$ref": "#/parameters/a"
},
{
"$ref": "#/parameters/b"
}
]
}
}
}