I have a parameter that a list of Strings, but the values must belong from a set of values.
This is what I have tried
#Parameter(description = "The type of status filters", content = #Content(array = #ArraySchema(schema = #Schema(implementation = String.class, allowableValues = {"Option 1", "Option 2", "Option 3"}))))
What I'm currently getting
As you can see, there is a text field.
I would like to have a drop-down instead.
Any suggestions on how to do it?
Solved by removing the implementation part
#Parameter(description = "The type of status filters", content = #Content(array = #ArraySchema(schema = #Schema(allowableValues = {"Option 1", "Option 2", "Option 3"}))))
Related
I want to transform the strategy code number in my Strategy Code column (Data table) into strategy name based on the dim_strategy table. My Challenge is there can be more than 1 strategy code appear in each row and hence I want to use + as the delimiter to combine different strategy name in Data table.
This is the desired output in Data table:
This query will achieve that for you. You will need to change the source for whatever your table source is but the rest of the steps should be exactly the same.
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"No.", Int64.Type}, {"Strategy Code", type text}}),
#"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Strategy Code", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Strategy Code"),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Strategy Code", Int64.Type}}),
#"Merged Queries" = Table.NestedJoin(#"Changed Type1", {"Strategy Code"}, dim_strategy, {"Strategy Code"}, "dim_strategy", JoinKind.LeftOuter),
#"Expanded dim_strategy" = Table.ExpandTableColumn(#"Merged Queries", "dim_strategy", {"Strategy"}, {"Strategy"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded dim_strategy",{"Strategy Code"}),
#"Grouped Rows" = Table.Group(#"Removed Columns", {"No."}, {{"Stretagy Name", each Text.Combine([Strategy], " + "), type nullable text}})
in
#"Grouped Rows"
Or you could add a column
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Added Custom" = Table.AddColumn(Source, "Strategy Name", each Text.Combine(
List.Transform(Text.Split([Strategy Code],","), each
dim_strategy[Strategy]{List.PositionOf(dim_strategy[Strategy Code],Number.From(_))}
),", "))
in #"Added Custom"
It converts the Strategy Code to a list, then to numerical list, finds the position of that in the dim_strategy Strategy Code column, then pulls the corresponding Strategy column and recombines the list into text
List.Buffer dim_strategy2[Strategy Code] as an earlier step if dataset is large
I am new to Flutter and Dart. I am trying to create long List View in Flutter. but I am stuck with this Constructor. Can anyone explain how this Constructor works?
List<String> = List<String>.generate(1000,(counter) => "Item $counter");
The following:
List<String>.generate(1000,(counter) => "Item $counter");
will generate a List of 1000 items, where each item are in order:
"Item 0"
"Item 1"
"Item 2"
...
"Item 999"
List<String> = List<String>.generate(1000,(counter) => "Item $counter");
this will generate 1000 item and you can manipulate each item threw your arrow function that takes counter as a parameter in that case counter will be ur index each time .
the output will be :
"Item 0"
"Item 1"
"Item 2"
...
"Item 999"
List.generate can be very useful if you know the length and structure of the list you like to create.
For example: You can create a List of maps too
Here generating a list with day e.g Mon, Tue,Wed,etc.. for the whole week
see the 7 as the number of iterations.
final myList = List.generate(7, (index) {
final dateFormatted =DateTime.now().subtract(Duration(days:index));
return {
'day':DateFormatted.E().format(dateF),
'date':dateFormatted,
};
});
print(myList);
I can't seem to find the option for ordering a reference item based on appearance of the key values in cite. I have the following in my .bib file:
#misc{test,
author = "Test",
title = "Title",
note = "6 October 2016",
howpublished = "\url{https://www.google.nl}"
}
which gives the following:
However I would like to have the reference item in the order: [Author, Title, Note, Howpublished] just as I have described in the #misc. Is this possible?
Below is the REST api which i want to document using Swagger UI
#ApiOperation(
nickname = "alertForBundleId",
value = "alertForBundleId",
notes = "",
httpMethod = "GET")
def alertForBundleId(
#ApiParam(name = "mfr", value = "Manufacturer", required = true) #PathParam("mfr") mfr: String,
#ApiParam(name = "col", value = "Columns", required = true) #QueryParam("col") cols: List[String])){...}
Here cols parameter is accepting List of string.When i pass two elements for the list separating by new line, then its generates url like ?col=sysid%2Calert_idwhile it should be like ?col=sysid&col=alert_idit works well for single element listAny help will be greatly appreciated.
Just picking upon Lua and trying to figure out how to construct tables.
I have done a search and found information on table.insert but all the examples I have found seem to assume I only want numeric indices while what I want to do is add key pairs.
So, I wonder if this is valid?
my_table = {}
my_table.insert(key = "Table Key", val = "Table Value")
This would be done in a loop and I need to be able to access the contents later in:
for k, v in pairs(my_table) do
...
end
Thanks
There are essentially two ways to create tables and fill them with data.
First is to create and fill the table at once using a table constructor. This is done like follows:
tab = {
keyone = "first value", -- this will be available as tab.keyone or tab["keyone"]
["keytwo"] = "second value", -- this uses the full syntax
}
When you do not know what values you want there beforehand, you can first create the table using {} and then fill it using the [] operator:
tab = {}
tab["somekey"] = "some value" -- these two lines ...
tab.somekey = "some value" -- ... are equivalent
Note that you can use the second (dot) syntax sugar only if the key is a string respecting the "identifier" rules - i.e. starts with a letter or underscore and contains only letters, numbers and underscore.
P.S.: Of course you can combine the two ways: create a table with the table constructor and then fill the rest using the [] operator:
tab = { type = 'list' }
tab.key1 = 'value one'
tab['key2'] = 'value two'
Appears this should be the answer:
my_table = {}
Key = "Table Key"
-- my_table.Key = "Table Value"
my_table[Key] = "Table Value"
Did the job for me.