Selecting all the items in dropdown using powerapps - listbox

I am trying to select all the items in dropdown using Powerapps. Below are the codes I was trying :
Concat(ListBox2_1.SelectedItems, Value & ",")
First(ListBox2_1.SelectedItems).Value
Concat(ListBox2_1.SelectedItems, Value & ",")
Please advise

Currently it is not possible to select multiple default values in the listbox (https://powerusers.microsoft.com/t5/Power-Apps-Ideas/ListBox-support-for-multiple-default-values/idi-p/280491). A control that supports multiple defaults that you can use would be the combo box. In this case, you would use the same expression for the Items property:
["Admin","Finance","HR","IT","ITES","Management"]
and the DefaultSelectedItems property:
["Admin","Finance","HR","IT","ITES","Management"]

Related

How do i remove rows based on comma-separated list of values in a Power BI parameter in Power Query?

I have a list of data with a title column (among many other columns) and I have a Power BI parameter that has, for example, a value of "a,b,c". What I want to do is loop through the parameter's values and remove any rows that begin with those characters.
For example:
Title
a
b
c
d
Should become
Title
d
This comma separated list could have one value or it could have twenty. I know that I can turn the parameter into a list by using
parameterList = Text.Split(<parameter-name>,",")
but then I am unsure how to continue to use that to filter on. For one value I would just use
#"Filtered Rows" = Table.SelectRows(#"Table", each Text.StartsWith([key], <value-to-filter-on>))
but that only allows one value.
EDIT: I may have worded my original question poorly. The comma separated values in the parameterList can be any number of characters (e.g.: a,abcd,foo,bar) and I want to see if the value in [key] starts with that string of characters.
Try using List.Contains to check whether the starting character is in the parameter list.
each List.Contains(parameterList, Text.Start([key], 1)
Edit: Since you've changed the requirement, try this:
Table.SelectRows(
#"Table",
(C) => not List.AnyTrue(
List.Transform(
parameterList,
each Text.StartsWith(C[key], _)
)
)
)
For each row, this transforms the parameterList into a list of true/false values by checking if the current key starts with each text string in the list. If any are true, then List.AnyTrue returns true and we choose not to select that row.
Since you want to filter out all the values from the parameter, you can use something like:
= Table.SelectRows(#"Changed Type", each List.Contains(Parameter1,Text.Start([Title],1))=false)
Another way to do this would be to create a custom column in the table, which has the first character of title:
= Table.AddColumn(#"Changed Type", "FirstChar", each Text.Start([Title],1))
and then use this field in the filter step:
= Table.SelectRows(#"Added Custom", each List.Contains(Parameter1,[FirstChar])=false)
I tested this with a small sample set and it seems to be running fine. You can test both and see if it helps with the performance. If you are still facing performance issues, it would probably be easier if you can share the pbix file.
This seems to work fairly well:
= List.Select(Source[Title], each Text.Contains(Parameter1,Text.Start(_,1))=false)
Replace Source with the name of your table and Parameter1 with the name of your Parameter.

Create a query params with combobox in Foxx

I wonder if I can create a query param that take multiple values from dropdown just like a non-typing combobox in the UI of ArangoDB. For example
//A route....
.queryParam('A', joi.any().allow(["true","false,"haha"]).required().default("true"))
The one above produce an dropdow that allow you to choose only 1 value. Is it possible to make them behave like a combo box on arango's UI?
I use this query param join's validation that shows as a drop down in the Arango UI
.queryParam('direction', joi.string().lowercase().valid('inbound', 'outbound', 'any')
.required().description('Direction of traversal from given product (inbound/outbound/any)'
))

How to change format / treat missing values in SPSS

I'm using SPSS modeler and I have a variable that the software recognizes as numeric. So the missing values are $null$. I want that the missing values of the variable are selectionable with '', as character.
So I would: or trasform the format of the variable from numeric to character or change only the missing values from $null$ to ''.
How can I fix?
thanks in advance
The best way to select null values in a numeric field is to use the #NULL() function from the Blanks and Null section of the Expression Builder.
For example, if you wanted to keep only the null values so that you could inspect them, you might use a Select node. Leave the radio button set as Include. Press the Expression Builder (calculator) button. Change the filter in the drop menu on the left side from General Functions to show Blanks and Null (press B 2 or 3 times). Double-click on #NULL(ITEM). Go to the right side and double-click on your numeric field name. Put a Table node at the end and run it.
Using Select #NULL in IBM SPSS Modeler
Another way to view just the null rows is to enter the #NULL(varname) function into the "Highlight records where" section of the Table dialog box.
"Highlight records where" dialog
When you run the table, any row that is true for this condition will be shown in red.
If you really need the variable to be a string, then use a Compute node to create a copy of this field under a new name and use the to_string() function in the Conversion section of the Expression Builder to change the type of the variable. Now you will be able to use the the Select node to grab "" as the missing value. Or you could use the Filler node to replace the column, but then you would not be able to compare before and after.
The dialog examples shown in this answer use this sample stream that is installed with your IBM SPSS Modeler software:
C:\Program Files\IBM\SPSS\Modeler\18.0\Demos\streams\featureselection.str
The easiest way to do it it's using the Fill node with the configurations:
A) FIELD
B) Condition = #NULL(#FIELD)
C) Replace by = ' '
This node will replace all $null$ for ' ' at the same variable chosen in option a.
I don't think you can customize how you visualize $nulls. (I know it's possible in SQL db though)
So I'd suggest that you work with the numbers and when you want to visualize or export the results, then turn the field to a string one then replace nulls:
Filled node > to_string(#FIELD)
Filler node > blank and nulls > #FIELD = ''

Is there any way to limit the selection of SelectItem in smartgwt?

I want to limit the check box selection of selectItem in smartGWT. My select item contains "n" number of options but the user wants to select only maximum of 7 options from the selectItem. How can i achieve this?
You can choose from several ways to achieve this.
I would choose between these two options (depending on your application):
Add a CustomValidator to that Formitem. This validator should evaluate to false if the SelectItem contains as value a list with more than 7 elements. Note that such a Validator could transform the value of the item and that you could specify the error message next to the formitem.
Add a ChangeHandler (via addChangeHandler) to the FormItem and chancel ChangeEvents when more than 7 elements are selected (and provide a notification to the user).

Can you add values to an Oracle APEX Shuttle item using a textbox?

The LHS is still dynamically populated with a query, but if it doesn't have a value that you want, then you can just type in a value in the textbox and then add that to the RHS of the shuttle (and update the corresponding tables in the database when you submit). It should also be okay to add that to the LHS when you click on the '<' or '<<' button.
I think that is doable. To add the value in the text box to the r.h.s. of the shuttle just do this:
:p1_shuttle := :p1_shuttle || ':' || :p1_textitem;
(You may need to set the shuttle item's LOV "Display Extra Values" property to "Yes" to be able to see the value.)
You are then able to shuttle the new value to the l.h.s. However, it won't appear on the l.h.s. after a page refresh unless in the meanwhile your code has added the new value to the table the LOV is based on.

Resources