Lowercase first letter of a parameter in the "dotnet new" template engine - dotnet-cli

I am building a template using the dotnet new template engine.
I have a parameter that looks like this:
"symbols": {
"rootEntity": {
"displayName": "Root Entity",
"type": "parameter",
"datatype": "string",
"replaces": "Notebook",
"defultName": "Notebook",
"isRequired": false,
"description": "An example root level data entity"
},
... other parameters here
}
It seems to mostly work, but it only replaces Notebook, not notebook. I could add another parameter for the lowercase version, but that requires users to type it in twice (yuck).
I saw the casing generator, but it does all uppercase or all lowercase (not just the first letter).
Digging more, I found a thing called a form that has the options firstLowerCase and firstUpperCase. But I can't find any examples using forms, only symbols (as shown in my example).
So, I have two possible questions (either will work):
How can I lowercase or uppercase the first letter of a symbol variable
How can I use forms in a template.
(I would prefer the second question as that enables me to use all the forms, but the first will get me moving forward, so I would be happy with either.)

Related

Word Online (Business) Connector - Populate a Microsoft Word template - how to get values for queries key; drive and file

When a Locic app (in Populate a Microsoft Word template) is adding a Document Library and a File at design time the values are transformed in the code behind view to this below
"queries": {
"drive": "b!pQtOjN9hhkuS3cqytiRbkgLNffrN86lAv6qypCvoFZHH47f9pgvOQbSdIQgHA6Er",
"file": "01COWZ3YIURGJHT27EDVCJJBJNMGO3QJZ4",
"source": "https://XXXX.sharepoint.com/sites/XXXXXX/"
}
Hov Can I get those values at runtime?
Here I provide my code view as an example:
In my code view, if I want to get the value of "dirve", "file" and "source", I can use the expression below:
drive:
actions('Populate_a_Microsoft_Word_template').inputs.queries.drive
file:
actions('Populate_a_Microsoft_Word_template').inputs.queries.file
source:
actions('Populate_a_Microsoft_Word_template').inputs.queries.source
Set the expression in your next action(such as "Initialize variable" action)
Then you can get those values and use them.

how to specify a variable/parameter in my logic app's arm template?

I am creating an Arm template for a logic app. This logic app needs to delete some old entries in azure table (say 10 or 20 days old).
In my arm template, if I do this, it works.
"queries": {
"$filter": "Timestamp le datetime'#{addDays(utcNow(),-31)}'"
}
But ideally I want to do this:
"queries": {
"$filter": "Timestamp le datetime'#{addDays(utcNow(),parameters('RetainDay'))}'"
}
Basically use a parameter to control the amount of days to check. I define this parameter as:
"parameters": {
"RetainDay": {
"type": "int"
}
}
When I deploy this, the parameters('RetainDay') isn't replaced to the parameter value. Instead it just stays same as:
Timestamp le datetime'#{addDays(utcNow(),parameters('RetainDay')
So I must be using the wrong syntax.
Can someone point it out?
You need to connect the 'Logic Apps template parameter' together with the 'ARM deployment template parameter', as much as it looks like the one and same variable, it is two parameters that work together. In my solution, I have a parameter called 'CustomVariableName'
Passing the parameter
Declaring the CustomVariableName in the "logic app code" and in the ARM template
Value in parameters file
Deployed Logic App in Azure
Postman POST response from hitting the HTTP trigger(instead of value: 'DefaultValue')
You need to use a concat() function to achieve string concatenation and variable expansion:
"$filter": "[concat('Timestamp le datetime\'#{addDays(utcNow(),', parameters('RetainDay'), ')}\'')]"
i think you can escape ' with \, if not, you can create a variable with the value ' and use that instead.
I see your template only set the parameter retionday type, you don't set the value. So go to parameter set the defaultValue like the below picture.
And I just use the this Filter Query Timestamp le datetime'#{addDays(utcNow(),parameters('retionday'))}', it will replace the time.
So please have a try, hope this could help you.

How can I make Alexa recognize number "two" and "four" in my utterance

I got a trouble about Alexa Number type. When I try to command number "two" or "four" Alexa always returns an undefined value or "?" to my server.
My utterance is as below:
echo, tell machine "Machinename" "action" "......".
"machine" is skill invocation.
"Machinename" is AMAZON.FOUR_DIGIT_NUMBER. I also tried it as AMAZON.NUMBER.
the second and third component is custom type and they are OK.
I have read almost topic related to this issue. I found solution {two|Machinename} is not worked with me. The Alexa skill kit always reponds as
"The built-in slot type "{two | Machinename}" cannot be extended with custom values. Error code: InextensibleSlot".
because "AMAZON.FOUR_DIGIT_NUMBER" and "AMAZON.NUMBER" is not extensible Built-In Types.
In another case when i tried to move "Machinename" to the last slot in my utterance. It still did not work. All numbers are ok except "two" and "four". So looks like it not related to invocation with "to" or "for".
Anyone please give me a solution or workaround.
ps: sorry for my bad English.
Thanks in advance.
I tried your interaction model with AMAZON.NUMBER instead of AMAZON.FOUR_DIGIT_NUMBER and everything is working fine. Slot values are mapped correctly.
Ex: ask machine number four start printing
Request generated:
"request": {
....
"machinename": {
"name": "machinename",
"value": "4",
....
"actionname": {
"name": "actionname",
"value": "start",
....
"functionname": {
"name": "functionname",
"value": "printing",
....
Hope this helps
After about 2 week i try to contact with Amazon also fine solution from the Internet. This times they can't help anything.
From the Amazon support team, they alway tell me recheck AMAZON.NUM/AMAZON.FOUR_DEGIT_NUMBER. I told them it alway ok with simulator and ask for help from real devices. But don't have any response as expected.
So this times, i tried to resolve this issue by another way:
AMAZON.SearchQuery ==> receive command string and process it yourself instead of slots.
Dialog Management.
Hope this helps

When isn't an IRI enough of a value in JSON-LD?

I'm playing around with JSON-LD but I think I'm missing something about linking. Gregg Kellogg's answer to Repeat whole JSON-LD structure or only the ID? almost clears it up for me, but not quite.
He has an example like this, where the author is an organization:
{
...
"author": {
"#id" : "http://example.com",
"name": "My Organization"
}
}
Which he simplifies at the end to look like this:
{
...
"author": {"#id" : "http://example.com"}
}
It seems to me that if I wanted to link to something, I should be able to simply reference it:
{
...
"author": "http://example.com"
}
That value would be seen as an IRI (assuming author is defined correctly) and that something would inflate the object at that IRI. However, almost all of the examples I see have extra stuff around that. What am I missing here? What can't I do if I just use the IRI instead of the method Gregg uses? He says that some people repeat parts of the graph, but that would seem to be a huge problem in managing data should I have to change a name. Is there a practical or theoretical problem there?
The sample on json-ld.org seems to be what I expect, but the things I've seen most often don't do it like this (linking to spouse):
{
"#context": "http://json-ld.org/contexts/person.jsonld",
"#id": "http://dbpedia.org/resource/John_Lennon",
"name": "John Lennon",
"born": "1940-10-09",
"spouse": "http://dbpedia.org/resource/Cynthia_Lennon"
}
I think in the end if doesn't matter because Markus Lanthaler also notes that you can't rely on parsers to inflate objects so you're stuck specifying everything all the time just in case.

How to highlight all matched word in single snippet in solr

All:
Right now, I am using SOLR highlight feature, but one thing I want to ask is:
Suppose I want to search keyword fund and value:
fund AND value
And the return highlight part is like:
"highlighting": {
"blk_0019": {
"content": [
"philosophy of the <em>fund</em> – <em>value</em> and turning point. \n \n MUSA was an orphaned"
]
},
"blk_0006": {
"content": [
"Global Equities <em>Fund</em> Ltd. \n \n CONFIDENTIAL enclosed"
]
}
}
The problem is I am sure blk_0019 and blk_0006 have both fund and value(obviously I use fund AND report), because the I set hl.fragsize=100, if the fund and value located not close enough in one document, they can not be shown both in same snippet. In blk_0019, solr highlights both fund and value, but in blk_0006, only fund shown.
How can I show both matched in single snippet and just ignore text between them as ..... like in Google
Also some small questions are:
[1] How to specify to search capitalized only word like Hello HELLO
in Solr?
[2] How to search All-capital AND(All-capital "AND" will be consider as logical operator)
Thanks
It depends on the highlighter you are using. For the Standard Highlighter you can set hl.snippets=5 for instance (default is 1). Then you'll get 5 snippets/fragments (at most), each with a maximum length of hl.fragsize.
They're returned as multiple values, so you'll need to join them yourself (using "..." for instance).

Resources