google-apps-script,listbox , Access dropdown items in Google App Scripts UiApp


Access dropdown items in Google App Scripts UiApp

Question:

Tag: google-apps-script,listbox

I'm using the older depreciated UiApp class in javascript (because I have to) where I have a dropdown list

I need to access the ListBox, and see all the values that it contains.

Is there a way to do this? All the items must be present because there is method that allows you to delete an item by it's index.

I don't want the single value that comes through on the form..


Answer:

Sadly not. The best you can do is store the items using the PropertiesService (or CacheService if the list is over 9kb) when the ListBox is created. Then you can walk that list at will later, and use the ListBox setSelectedIndex() method if needed.


Related:


Google Spreadsheet custom function to add csv in spreadsheet


google-apps-script,google-spreadsheet,google-spreadsheet-api
I am using Google spreadsheets, and in my google spreadsheet i want to import data from my RESTful web service. I cant use =IMPORTDATA due to the fact that i need to add a header to the url for auth purposes. This is the custom function i have so far:...

Select2 using Ajax (multi select) - when selecting second one first one disappars


jquery,ajax,model-view-controller,listbox
I am stuck on this problem - the ajax call retrieves the categories ok from the database, and when I select the search result the first time it also shows up in the search box. It is only when I select the search result the second time, first and second...

getJSON from Google Apps Script not working in Safari


google-apps-script,safari,getjson
I've created this piece of code to handle my user login. var gasUrl = "https://script.google.com/macros/s/[my id]/exec"; function submitFormData() { var username = $("#inputEmail").val(); var password = $("#inputPassword").val(); $.getJSON(gasUrl + "?username=" + username + "&password=" + password, function(data) { if(data[0]) { localStorage.setItem("username", data[0].username); localStorage.setItem("id", data[0].id); window.location.href = "/index.php"; } else {...

Images aren't displayed in WPF ListBox


wpf,data-binding,listbox
I'm trying to display images in a ListView. The images are being loaded through Entity Framework from a SQL Server database. Somehow the images don't get displayed in the ListView and I can't figure out why. I've created a test Visual Studio project. The images are stored in an ObservableCollection<ImageViewModel>:...

ListBox ItemsPanel Style


c#,wpf,listbox
I'm trying to stylize my ListBox and I would like that my Items like this: 1 4 7 10 13 16 19 22 25 28 2 5 8 11 14 17 20 23 26 29 3 6 9 12 15 18 21 24 27 30 Only 3 items vertically and...

Google Spreadsheet setBackgroundColors() “Deprecated”


google-apps-script,google-spreadsheet
A gs I have been using in the past to check for duplicates, is no longer working. The script would check all cells in the spread sheet if any were identical it would highlight all their occurrences green. I also had another function that would revert all the cells back...

How to pass all value of ListBox Control to a function?


vb.net,listbox
I am writing a simple application to read the value a textbox and add to a listbox control . But i have to pass the listbox control to function . Any suggestion ? Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load test("E:\Satyajit.txt") End Sub Public Function...

Javascript (Google Scripts) value from a function is not returning


javascript,google-apps-script,google-spreadsheet,google-calendar
I think could be a simple one to solve, I am stuck working this simple issue out. I have called a createEvent function to create a google calendar event. As part of this function I also get the google calendar event ID as EventId and want to return it. For...

Constantly getting an email: Cannot read property “0” from undefined


javascript,google-apps-script,gmail
I am constantly getting emails from "me" with this in it: Cannot read property "0" from undefined. I think it has something to do with Google Apps script because it started when I tried to code something. (for details: I was trying to code a "Contact Us Form" for my...

How to real-time monitor the emails?


api,google-apps-script,gmail,quota
Good day! I want to offer the implementation of google apps to my company. Also we have a need to reply on messages, that we recieve through our web-site in 10 minutes time limit. For this purpose our big team of sales managers a handling emails when they have a...

Google Sheets Adds-on open automatically when user opens a sheet or clicks a link in worksheet


google-apps-script,google-spreadsheet
I created an google sheets add-on. However, it is a bit hidden in the adds-on menu. Is there a way to enable the Adds-on automatically when user opens a sheet or when user clicks a link in a sheet? I searched on Google Sheets documentation but found nothing. EDIT1: Since...

Google Apps Script return array values and use them in a javascript function


javascript,arrays,google-apps-script
I am trying return an array and use it in a javascript function, but it doesn't seem to work. My Code.gs is as follows: function doGet() { return HtmlService.createHtmlOutputFromFile('test') .setSandboxMode(HtmlService.SandboxMode.IFRAME); } function test() { var locations = []; var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/13q7pIeMUHll6_5xBUpBavaBqALt9fnFnOIO-Hwy_pFc/edit'), sheet = ss.getActiveSheet(), range = ss.getRange("D2:D4"), values =...

Access dropdown items in Google App Scripts UiApp


google-apps-script,listbox
I'm using the older depreciated UiApp class in javascript (because I have to) where I have a dropdown list I need to access the ListBox, and see all the values that it contains. Is there a way to do this? All the items must be present because there is method...

WPF Listbox Collection custom sort


wpf,sorting,listbox,compare,collectionview
I have a listbox DropPrice MyPrice Price1 Price2 I want to sort it like this Price1 Price2 DropPrice MyPrice I mean, if there's an item that starts with the sequence "price", it gets priority, else the smallest string should get the priority. My source code: var lcv = (ListCollectionView)(CollectionViewSource.GetDefaultView(_itemsSource)); var...

Output API data to a csv file


google-apps-script
I have Frankenstined bits of code together found on here and on various Google tutorials. My goal is to get data from the Google Analytics API and output it to a file in my Google Drive "my_data.csv". I am able to get my data from the GA API in a...

Script for Gmail label to Sheets


google-apps-script,gmail
I am trying to make a script that takes an email within a certain label and puts it into google sheets. Im using this function at the moment: function getMessagesWithLabel() { var destArray = new Array(); var threads = GmailApp.getUserLabelByName('Facebook').getThreads(0,10); for(var n in threads){ var msg = threads[n].getMessages(); var destArrayRow...

How to make if statement that checks if multple listBoxes are empty or not?


c#,winforms,if-statement,listbox
How do I make an if statement that asks if multiple listBoxes are empty or not? This is what I have so far...is it possible to combine it into one single if statement? if (listBoxEmails.Items.Count < 1) { //Perform action } if (listBoxWebsites.Items.Count < 1) { //Perform action } if...

Storing Individual Values From List Box As Variables


c#,listbox,sqlconnection
I have a listbox which is currently reading fields from my database. I would like to be able to store each individual values that I am reading in as strings and ints. There will four field types, these are Surname, Forename, EmployeeID, PaymentDate. How do I split and store the...

How to prevent Google Forms from converting form input to scientific notation format


javascript,google-apps-script,google-docs,google-form
I have a simple script set up that sends emails based on Google form entries using a script-based VLookup to get the contact emails. In some cases, Google Forms converts longer numbers entered into the form field to scientific notation. A workaround I have been using is to enter an...

Get column to display month name Google App Script


google-apps-script
How do I set a column to display the name of the month instead of the whole date using the script? The function can manually be performed by selecting Format>Number>August in the menu but I want to do this in code. This is what I've tried but I can't seem...

Excel VB Listbox losing Value and Text Property


excel,excel-vba,properties,listbox
I'm trying to solve this problem along 2 days but I've not found the solution. I have a lot of listboxes on my excel and each of these listboxes are filled with different data, also I use these listboxes to change some filters at a pivot table using a VB...

WPF : How to bind Button's visibility inside ListBox ItemsControl using selecteditem information ?


c#,wpf,listbox,itemscontrol,selecteditem
I have a list box binds to a ObservableCollection of Items. Each listboxItem contains a few textblocks and a few buttons. I would like to show the buttons inside the listboxItem only when the listbox item is selected or hightlight. If the listbox item is not highlighted, the button should...

Pass webapp link parameter to html file in Google Apps Script


google-apps-script
I am trying to pass a parameter from a webapp link, so it can be used to pre-fill an html form (using HtmlService). Apps Script - function doGet(e) { var formId = e.parameter.formId; return HtmlService.createTemplateFromFile('Index') .id = formId .evaluate() .setSandboxMode(HtmlService.SandboxMode.IFRAME) } Index.html - <form id="myForm"> <input type="text" name="formId" value="<?=id?>"><br> <input...

WPF Extended ListBox doesn't find definition


wpf,xaml,listbox
have extended ListBox to give me a horizontal List Box, i.e, in XAML: <ListBox x:Class="Renishaw.Inspire.InTheatreCompanion.View.HorizontalListBox" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Style="{x:Null}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel Name="ItemContainer" Orientation="Horizontal"/> </ItemsPanelTemplate> </ListBox.ItemsPanel> </ListBox> and in the code behind public...

Google Apps Script - Sharing outside of domain


google-apps-script,google-form
So I have followed the tutorial here, and everything works great... for me. google forms file upload complete example What I need to do is add the script to a Google Form, and allow users to upload an image along with the form. I know it will only put it...

Search for value in variable Google Apps Script/JS


javascript,google-apps-script,google-calendar
Trying to determine if calendar events in Google Calendar were created by the user himself or if a CSV bulk upload was performed. If the script finds an ID with "CSV" somewhere in the value, then remove it. I tried to add an if statement where it looks at the...

Google sheet app script errors after laptop sleep


google-apps-script,google-spreadsheet
I have a custom function in a sheet that calls a mysql database. It extracts one value from mysql per row, e.g. | A | B -------------------------------- 1 | YES | =readCompleteFromMember(A1) 2 | NO | =readCompleteFromMember(A2) If I let my laptop go to sleep and open it the next...

How to get the last entry containing a certain value in Google Spreadsheet


google-apps-script,google-spreadsheet,google-form,formulas
I have an answer spreadsheet linked to a Google form. I wish to get the last date that and answer was submitted. Lets say I my entries look like this : DATA : A B 1 Date String 2 2015-05-09 Abb 3 2015-05-11 Bcc 4 2015-05-12 Cdd 5 2015-05-20 Bcc...

Userform listbox rowsource not populating


excel,excel-vba,listbox,userform
I have a userform with an OK and Cancel button and a listbox. It is supposed to populate using this code: Private Sub UserForm_Initialize() Me.StartUpPosition = 0 Me.Top = Application.Top + (Application.Height / 2) - (Me.Height / 2) Me.Left = Application.Left + (Application.Width / 2) - (Me.Width / 2) With...

c# How to sort an array and put in a listbox?


c#,sorting,listbox
I am new to C# and I am trying to sort numbers from lowest to highest and then put them inside a ListBox. What I did so far is: { int[] sortArray = new int[listBox2.Items.Count]; for (int i = 0; i < listBox2.Items.Count; i++) { string sort = listBox2.GetItemText(i); sortArray[i]...

Output Google Spreadsheet to XML/RSS/Atom using Google AppScript Content Service


xml,google-apps-script,rss,google-spreadsheet,google-docs
So I've searched this site and found nothing really useful so far to accomplish this. I am wanting to turn a spreadsheet into an RSS feed using google script content service. How do I declare column values (i.e. pubDate, Author, Content) so it will output correct RSS/Atom feed. Following their...

tkinter: progress list not updating


osx,python-2.7,user-interface,tkinter,listbox
I have great difficulty boiling down my problem into a fundamental one, so my apologies if this is already treated in another question. My problem lies in providing progress feedback to the user. The basic system is used to import files, analyze them (with an external function) and in the...

How can I exclude a sheet in an array, and sort with a range


google-apps-script,google-spreadsheet
Good Morning everyone I have a code that was posted here a while back, I recently started using for a google spreadsheet and tweaked it a bit, how ever there are 2 thigs I have not been able to accomplish the first thing is to Exclude the Master sheet from...

Google Form to Document Merge to Pdf to Mail


google-apps-script,google-spreadsheet
I think my issue is in the e.values I am using along with the ('keyXXXXX', XXXXX); that I am using. The original code I used was something I borrowed from TJ Houston's site. I am using it for an application process. I wrote the code following the process of using...

Break Google Apps HTMLService Page into multiple .html files


google-apps-script,google-apps
I want to combine a few related HTMLService interface in to a tabbed page. I can get the tabs working using the code here. But I want to put the page for each Tab into a different html file in the project. How would I show Billets.html inside the div...

Google Spreadsheet (Using named range in script)


google-apps-script,google-spreadsheet
Trying to get my script to use a named range. In that range I am trying to reset the cell colors back to white. I keep getting an object error, can't figure out how to make this work. function resetCheckDirectory() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var tableRange = ss.getRangeByName("rangename"); tableRange.setBackgrounds("#FFF");...

Getting selected items from a listbox using the index instead of value


c#,listbox,code-behind
When I fill a listbox, I do something like this: SqlDataAdapter adapter = new SqlDataAdapter("Select [DDLValue], [StoredValue] from [tmpDropdowns] WHERE DDLName = 'ddlHobbies' ORDER BY [SortOrder] ASC", conn); adapter.Fill(DDLHobbies); Hobbies.DataSource = DDLHobbies; Hobbies.DataTextField = "DDLValue"; Hobbies.DataValueField = "StoredValue"; Hobbies.DataBind(); And when I want to retrieve the items, I do something...

Problems with displaying an user selection from a Combobox in a Listbox


python,combobox,tkinter,listbox
I want the follow code snippet to take the user selection from the combobox and display it in a Listbox I have set up. When I run the code, and select from the combobox, the selection is displayed in the listbox as <tkinter.StringVar object at 0x1007ae748> instead of the actual...

Adding items to a ListBox in a parallel way


c#,wpf,listbox,task-parallel-library,backgroundworker
I'm writing a simple application (for testing purposes) that adds 10 M elements to a ListBox. I'm using a BackgroundWorker to do the work and a ProgressBar control to display the progress. Each element is a just a "Hello World!" string with and index that I'm adding during the process....

WPF Interactions CallMethodAction for DataTemplate in ListCheckBox thrown a exception “Could not find method on object of type”


c#,wpf,xaml,checkbox,listbox
I'm trying to use interactions, but I can't write ordered params in my method in ViewModel. I'm use a ListBox who have items inner a checkbox and another controls. So I trying to use the different combinations of params TargetObject of CallMathodAction in my usercontrol, but I can't get the...

Google Sheets API for clickable images in Google Sheets


google-apps-script,google-spreadsheet,google-spreadsheet-api,google-spreadsheet-addons
In Google sheets, you can insert a clickable image to a cell which links to a function in app script. Can we also insert this clickable image and link it to app script from our server using Google Spreadsheet API? Or Can we call app script from our server? https://developers.google.com/apps-script/guides/menus#clickable_images_and_drawings_in_google_sheets...

Images not appearing on WPF form when loading asynchronously


c#,wpf,multithreading,listbox,backgroundworker
I'm attempting to display (in a ListBox with a custom DataTemplate) a series of BitmapSource frames (thumbnails) extracted from a multi-page tiff image. When I process the tiff on the UI thread, and either directly add the images to a listbox's item collection or add them to a bound ObservableCollection,...

Merging Multiple Arrays Evenly/Alternating with Javascript and Google AppScript


javascript,arrays,google-apps-script,merge
I'm trying to merge multiple arrays evenly/alternating in javascript/Google appScript. There are several arrays (5 or 6). I've tried 2 different methods, but neither worked. I don't work a lot with javascript honestly and I've managed to get the code to this point, but I can't get it merge properly;...

Google spreadsheet script authorisation to BigQuery


google-apps-script,google-spreadsheet,google-bigquery
I have a Google spreadsheet with a script that connects to BigQuery (using this tutorial - https://developers.google.com/apps-script/advanced/bigquery?hl=ar-AE). It adds an extra menu option and users can run the script that executes a query to BigQuery. It works fine for me and I want to share this spreadsheet with other users...

C++ Windows API DlgDirList sometimes don't return the correct listing


c++,winapi,listbox,directory-listing,file-listing
I have 2 List Box, one always listing directories from a path and other listing the files from the selected directory. The first time i select a directory, the files are shown properly, but if i select another directory, it lists nothing. That's my current main.cpp, where all GUI stuff...

ListBox that updates another part of View


c#,html,asp.net-mvc,razor,listbox
I want a ListBox, that when submitted, will send its selected values to a controller, and the response from that controller will be used to update a small piece of the view. The following code is able to update the part of the view, and get the selected values, but...

How to remove duplicates in ListBox?


delphi,listbox,duplicate-removal
I use this code to remove duplicates: procedure TForm1.RemoveDuplicates(StrList : TStringList); var NoDuplicate: TStringList; i: Integer; begin NoDuplicate := TStringList.Create; try NoDuplicate.Sorted := True; NoDuplicate.Duplicates := dupIgnore; /// for i := 0 to StrList.Count - 1 do NoDuplicate.Add(StrList[i]) ; /// NoDuplicate.Sorted:= False; StrList.Assign(NoDuplicate) ; finally NoDuplicate.Free; end; end; It works...

Script to check for email subject not in inbox runs without error but not as expected. Not sure what is wrong with syntax.


google-apps-script
I get an automated email when an event occurs, but need to be notified if it isn't received. It's easy to overlook something that doesn't happen. Here's what I have, but the var c remains 0 when script ends (I'm expecting it to not be 0 if email is found,...

How to remove quote mark from array


javascript,google-apps-script
I have a script that will import data from a csv file in to a Google sheet. I would like to include the following to remove the quote marks from the data - .replace(/"/g, "") - but am not sure of the best place/syntax to add in to the existing...