I am trying to generate mock data with Mockaroo and need a simple data type that is unfortunately not inside Mockaroo's built in available data. It is very simple, a status data type that has the following values:
Status = {Pending, Filled, In Progress}
How do I create a custom datatype that will let mockaroo choose from any 3 of these words randomly when generating data?
Related
I am trying to generate a random response for my Alexa Skill. I have set it up as:
Intent = myIntent
Slot = mySlot
Slot Type = mySlotType
Slot Values = {A,B,C,D} //the ids are unique numbers 1 - 4
when the user says a word such as A it uses this to create a response. Now I want to add a case for 'random'.
So Slot Values = {random,A,B,C,D}. //ID for random is 0
When the user says random, I want to randomly choose from the other Slot Values and use this to create a response.
Can Slot Value ID be used to return the Slot Value value?
Anybody know a good way to do this? I am a novice so excuse any obvious oversights.
This might be a workaround for your problem. You can get the JSON structure of your interaction model and use it as a constant in your lambda index.js file. I usually use this official tool for generating backend code for my skill
:
https://s3.amazonaws.com/webappvui/skillcode/v2/index.html.
When you'll generate the code through this tool, you'll see that the code generated also has the whole interaction model used as constant. Since you will have the whole JSON schema of the interaction model at your disposal, you can perform any action on it.
Note: If you don't know where to get JSON schema of your interaction model, scroll down on the build tab of your skill on the developer console, you'll find a menu of JSON editor on the left navigation. It will give you the JSON schema of your interaction model.
You can use mySlot as optional value in the intent description. For example you can add few utterances without slot inside them. And on the backend side you can check is the slot filled. If it is not filled you can generate random answer.
I am trying to write a Swagger API document but I am having issues with one particular scenario.
I have a huge grid with id references in each (think Chess Board) and I want to send grid references that have changed and the new ID in each. So I may have a 40x40 grid and I change one of the grid squares to a different value.
I want to send to my API :
12x21 = 12345
23x11 = 87654
42x01 = 12987
23x09 = 19283
Without having to list every single grid position in swagger as a parameter, how can I represent this scenario using Swagger UI?
I would design one endpoint where you send the change to as a PUT request (or a POST request if it is a new id, it's hard to tell from the context), with the actual change as the JSON body of your request. The reference to your grid could then either be sent as query parameters or as part of the JSON body.
I have to get number of input tabs or fields based on given xml or json file.
example : If xml has 3 tags, then form should contain 3 input fields.
Same with JSON.
You can use ng-repeat on service response array of objects. And also you can create new scope variable & assign unique property of response array object to it. Then you can have as many number of input fields based on service data & also dynamic ng-model on them to handle their model data to submit it.
This is small example which demonstrates your requirement: http://jsfiddle.net/DrQ77/
For xml response, better use xml to json library plugins to convert it to json data https://github.com/abdmob/x2js. Or prefer server side sending json data (with implementing xml to json functionality at server side).
I am just trying to login into a web application and filling out the input criteria(10 text fields) and clicking on submit.I am getting data from xml.
My doubt here is we can get input data from excel,xml,json,etc..But which is better,efficient and lightweight.Please suggest
You can use different approaches. For example:
If you want representation of object (you have object structure), you may store information in XML/json, load data into Entity and pass data into page using this Entity.
If you want just load data and don't want to use objects or your data unstructured (it can't be represented as object), you may use txt/csv/excel
something else (depends on your situation)
I'm trying to get over a limitation in Salesforce where Lead objects can't have related lists that convert with the Lead over to Opportunity, Contact and Account. I have set up 4 objects of type Lookup Relationship, and created a dummy record in each.
I want to use Custom Settings to store the id of each of these dummy records, so that when the Lead converts, any custom objects can also convert to objects with Master/Detail relationships on the respective standard objects.
My trigger on Lead(after update) tries to create a Map of the Custom Settings:
Map cs = AcctId__c.getAll();
AcctId__c is the Custom Setting api name. Compile time is giving me the above message.
Now, I copied this code directly from the Salesforce documentation. What am I forgetting?
I believe that you must include the actual map definition <String,AcctId__c> after the word Map.
Check out this page.
http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_collections_maps.htm