Buttons for Filter Views - google-apps-script

I'm trying to prepare a large contact sheet on the new Google Sheets.
I want to be able to quickly filter through the data (7-8 presets).
I was initially setting this up on Excel using Slicers, which did the job quite well.
The Filter Views work pretty well for what I want, but I want it to show in the form of buttons showing up on the spreadsheet. Is there a Macro I can write to do this? Is there an API open that can access switching on and off of filter views?
If yes, that will do the job perfectly. If not, Can I call filters and not filter views somehow? And hardcode the filter conditions into the macro buttons?
In Short : I want toggle buttons to turn on/off all Filter Views.
Please drop in your suggestions about other alternatives to do this

Although this is an old question, I thought I'd share my solution:
Create a filter view, and look at the browser address bar. You'll see the URL for the filter view eg:
https://docs.google.com/spreadsheets/d/1vq6yK7m3HxxxxxxxxxxxxxxxxxQyv3ASdA/edit#gid=10999999999999948&fvid=2049999999922
Note the numbers after #gid and &fvid which refer to the google sheet and filter view ID respectively.
Go to a cell within the spreadsheet and enter the formula:
=hyperlink("https://docs.google.com/spreadsheets/d/1vq6yK7m3HxxxxxxxxxxxxxxxxxQyv3ASdA/edit#gid=10999999999999948&fvid=2049999999922", "Name of the filter view")
The cell will show the familiar blue underlined "Name of the filter view" and clicking on it will show the filter view.

Related

How to make Google Forms dropdown list searchable? [duplicate]

I'm trying to create a google form with a field which takes the values as a list from spreadsheet. Right now i'm using formRanger scrip but my list is to long, 200 entries, how can i make it similar to android contact search. That it will filter the entries based on keystroke.
So it seems that nothing has changed in the last 8 years and the best solution to date seems to:
put the long list as a single question on separate section
advice users to use Ctrl+F to find the needed option.
This has advantage over drop-down that it's much easier to scroll the whole page than dropdown which user can accidentally close and will need to open and search again.
It sounds like you are looking for an "Autocomplete" entry for your form.
As the user types an entry into the form field, a dropdown list appears showing matching entries lifted from a Google spreadsheet column.
The following solution using HtmlService works great for lists having over 200 entries.
I've tried it!
"Populate jQuery autocomplete list using value array from Google Spreadsheet"

Changing date range for chart based on selected dropdown value

I have a Google Spreadsheet like this with a chart and a dropdown menu. I would like the data range of that chart to update based on a value selected from a dropdown menu.
I thought I might be able to add a Google App Script to the dropdown menu, but I can't find a way to add such script to anything but a drawing. Can someone tell me how to achieve this? Or point me into the right direction (Doc link?) as I'm new to both Google Spreadsheets and App Scripts.
Update:
From the comments it seems using App Scripts onEdit trigger might work.
The idea would be
to trigger onEdit when the value from the dropdown cell changes
fetch the cell value to use as an argument for another function
that in turn alters the data range of a chart.
As far as I can see onEdit triggers with changes made to any cell. Is there a way to limit this trigger to specific cells/ranges?
If I were you, I would use your drop-down menu as reference in a Query(). Often, I'll use a Query() in a hidden section of columns on my sheet, and use that hidden section as the data range for my charts. For example, if your drop down was in A1 you could have in B1 a Query() that uses a cell reference to find your data, and then hide columns B through however many you need to display your data. Then you make your data range B1:D (or whatever the range actually ended up being). Your example sheet has been moved to your trash, but if you share a data set with me, I could show you a pertinent example. Here is a less than pertinent example Ta-Da. I know that it is probably too general to use for your specific case, but perhaps if we knew more we could point you to a more specific work-around.

Data label Google spreadsheet Column chart

I have created a column chart in Google spreadsheet, but it is not showing data label explicitly.
I need data value to be shown on top of each bar of column chart. Currently, that is showing only as tool tip, but I require it to be always visible.
I have not used any script just created it directly, please provide some way either by script/direct to implement data labels. only direct / apps script but no java script as I only need to view it on my spreadsheet.
here is link of sheet: https://docs.google.com/spreadsheets/d/1a95DrTeLA52Xmycq3IUlWgfqASQWJQla7xEXx5-KWGE/edit?usp=sharing
You may have found the solution by now but just in case it might be helpful to others, here's my response.
Your sharing of sheet was useful in helping you with your question. Here are the steps to get the values for the data labels on the top of your columns.
Right click on the chart.
Click on Advanced Edit. (This will open a new window named "Chart Editor")
Click on "Customization" tab.
Drag the bar and keep going down until you see "Data Labels" with a drop down below it.
Click on the drop down. (This will open a list of options)
Choose "value" from this list of options.
Click "Update" and you'll see the change in your graph.
Let me know if you have any questions.
I figured out a solution. If you create a pivot table and graph that data, the values will show.

Google Script: Using an input text box in a form that pulls items from the sheet and presents as options

I am currently developing a program in Google Script that works with Google Sheets. I've created a tab that serves as the UI and have multiple tabs for each data type to store the data.
When I first started, I originally reserved some cells on the UI tab that I used as the inputs for creating a parent-child relationship instance. To do this, I directly set validation on each of the cells and used the "List from a range" Criteria to provide the drop-down list to provide the options to select from.
Now, I am trying to move this input off of the cells in the UI tab and into the sidebar. I am now using HTML Service and am creating a form to handle this functionality. However, I can't figure out where to get started to provide the same drop-down functionality for each of the text inputs in the form as I had when I used the cell validation.
Does anyone know what syntax is used to do this?
Thank you,
Nicholas Kincaid
jQuery auto-complete combo-box is what will take care of this => jqueryui.com/resources/demos/autocomplete/combobox.html

Google form with a filter field

I'm trying to create a google form with a field which takes the values as a list from spreadsheet. Right now i'm using formRanger scrip but my list is to long, 200 entries, how can i make it similar to android contact search. That it will filter the entries based on keystroke.
So it seems that nothing has changed in the last 8 years and the best solution to date seems to:
put the long list as a single question on separate section
advice users to use Ctrl+F to find the needed option.
This has advantage over drop-down that it's much easier to scroll the whole page than dropdown which user can accidentally close and will need to open and search again.
It sounds like you are looking for an "Autocomplete" entry for your form.
As the user types an entry into the form field, a dropdown list appears showing matching entries lifted from a Google spreadsheet column.
The following solution using HtmlService works great for lists having over 200 entries.
I've tried it!
"Populate jQuery autocomplete list using value array from Google Spreadsheet"