Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In general, GetCurrentSelections() function returns a list of the current selections in the app. If the selections are instead made using a search string in a search box, GetCurrentSelections() returns the search string. Is there a way to display the list of current selections when selections are made using a search string as well.
For example, when user types in like ‘*2020* in date fields or copy paste multiple values in the number field and hit enter, it displays only those values that we enter in the search box when using GetCurrentSelections function. But the actual values that gets selected when typing in the values in the search box is not getting displayed.
Function used to display the values - GetCurrentSelections(chr(13)&chr(10),': ',', ',50)
Any suggestion to display these values will be really helpful. Below are the example screenshots.
Typed in *2020* in the Date field, instead of displaying the dates that gets selected for the 2020 year, it displays like *2020*
Below is the Number field values copy pasted in the field and pressed enter. Instead of displaying the unique values with comma separated when we generally select, it displays all the values when copy pasting values and pressing enter.
100001
100002
100003
100004
100003
100005
If you are after specific fieldnames, you can do something with Concat like:
=Concat(Distinct Year, ', ')
-Rob
-Use a complete if() for each column that returns either the formatted string or ''.
-Concatenate each if() with the "&" string concatenation operator.
if(GetSelectedCount(DateTest)>0,'DateTest '&Concat(Distinct DateTest, ', ')&chr(13)&chr(10),'')
&
if(GetSelectedCount(NumberTest)>0,'NumberTest '&Concat(Distinct NumberTest, ', ')&chr(13)&chr(10),'')
-Rob
Try this for selected values
Concat({<DateField= {"$(=SelectedValues(DateField))"}> } Distinct DateField, ', ')
For the number field you can use below
Concat({<NumberField= {"$(=SelectedValues(NumberField))"}> } Distinct NumberField, ', ')
If you are after specific fieldnames, you can do something with Concat like:
=Concat(Distinct Year, ', ')
-Rob
Thanks a lot @rwunderlich. This really works at individual column level.
In our dashboard, we have around 50 columns in a table and we need to create 50 separate measure columns for each of the fields to achieve this functionality. Keeping all the 50 columns in one measure column using if condition is not displaying the values for all the selections, just the first selection column value is getting displayed. Any suggestion to overcomes this will be really helpful.
Expression Used:
if(GetSelectedCount(DateTest)>0,'DateTest '&Concat(Distinct DateTest, ', ')&chr(13)&chr(10),
if(GetSelectedCount(NumberTest)>0,'NumberTest '&Concat(Distinct NumberTest, ', ')&chr(13)&chr(10)))
-Use a complete if() for each column that returns either the formatted string or ''.
-Concatenate each if() with the "&" string concatenation operator.
if(GetSelectedCount(DateTest)>0,'DateTest '&Concat(Distinct DateTest, ', ')&chr(13)&chr(10),'')
&
if(GetSelectedCount(NumberTest)>0,'NumberTest '&Concat(Distinct NumberTest, ', ')&chr(13)&chr(10),'')
-Rob
@rwunderlich Thank you so much. This works great.