Google Sheets getting Invalid error in drop down but item is on the list - validation

In Google Sheets, I created a data validation cell to select different time slots. I am getting an error when choosing 6:00, 7:00, 8:00, 9:00 even tho all of them are in the list. Error says: "Invalid: Input must be an item on the specified list"
Added the data validation like this:
Thanks a lot in advance!
The file is here: https://docs.google.com/spreadsheets/d/1NSBx87sWScwe2Vtp9FOcH3BupvPJ_jzISUeAk6gSBOM/edit#gid=612415402

Make sure to actually pick a choice on the dropdown OR your input is exactly the same with the choice.
By default, when you manually enter 6:00-9:00 it automatically adds 0 in the beginning as sheets has detected your input as time.
So you should update your data validation list to use 06:00-09:00 instead so it matches when sheets adjusts your input when they are manually entered.

Related

How to properly scraping filtered content using XPath Query to Google Sheet?

So, this is about a content from a website which I want to get and put it in my Google Sheets, but I'm having difficulty understanding the class of the content.
target link: https://www.cnbc.com/quotes/?symbol=XAU=
This number is what I want to get from. Picture 1: The part which i want to scrape
And this is what the code looks like in inspector. Picture 2: The code shown in inspector
The target is inside a span attribute but the span attribute looks very difficult to me, so I tried to simplify it using this line of code here =IMPORTXML("https://www.cnbc.com/quotes/?symbol=XAU=","//table[#class='quote-horizontal regular']//tr/td/span")
Picture 3: List is shown when putting the code
After some tries, I am able to get the right target, but it confuse me, Im using this code =IMPORTXML("https://www.cnbc.com/quotes/?symbol=XAU=","//table[#class='quote-horizontal regular']//tr/td/span[#class='last original'][1]")
Picture 4: The right target is shown when the xpath query is more specified
As what you can see in 2nd Picture, 'last original' is not really the full name of the class, when I put the 'last original ng-binding' instead it gave me an error saying imported content is empty
So, correct me if my code is wrong, or accidental worked out somehow because there's another correct way?
How about this answer?
Modified formula 1:
When the name of class is last original and last original ng-binding, how about the following xpath and formula?
=IMPORTXML(A1,"//span[contains(#class,'last original')][1]")
In this case, the URL of https://www.cnbc.com/quotes/?symbol=XAU= is put in the cell "A1".
In this case, //span[contains(#class,'last original')][1] is used as the xpath. The value of span that the name of class includes last original is retrieved. So last original and last original ng-binding can be used.
Modified formula2:
As other xpath, how about the following xpath and formula?
=IMPORTXML(A1,"//meta[#itemprop='price']/#content")
It seems that the value is included in the metadata. So this sample retrieves the value from the metadata.
Reference:
IMPORTXML
To complete #Tanaike's answer, two alternatives :
=IMPORTXML(B2;"//span[#class='year high']")
"Year high" seems always equal to the current stock index value.
Or, with value retrieved from the script element :
=IMPORTXML(B2;"substring-before(substring-after(//script[contains(.,'modApi')],'""last\"":\""'),'\')")
Note : since I'm based in Europe, you need to replace ; with , in the formulas.

WebEdit and List Combo field Automation using UFT

Hi I am trying to Automate the input field for searching the equity on the website "https://www.nseindia.com/" using UFT. I am able to set value in the WebEdit field but I am not able to submit using UFT
Below is the descriptive code :
Set Obrowser = Browser("name:=NSE - National Stock Exchange of India Ltd\.")
Set oPage = Obrowser.Page("title:=NSE - National Stock Exchange of India Ltd\.")
oPage.WebList("html id:=QuoteSearch").Select "Equity"
oPage.WebEdit("name:=companyED","index:=0").Set "SBIN"
oPage.WebEdit("name:=companyED","index:=0").Submit
enter code here
Image of the field which is highlighted
Could you please help me in handling this type of input box which is shown in screenshot
I see that when you set a value in the search field we get a list of matching results. If you click on the appropriate result the search is performed.
Instead of submit try the following:
oPage.WebElement("html id:=ajax_response").Link("text:=.*SBIN.*").Click
This assumes there is only one match (you can fine-tune it if there are more).
Explanation:
We first look for the list of results that fit the search term (this is in a SPAN with id=ajax_response). Then, under that, we look for the Link that we want to click on. In this case there's only one match so the description doesn't really matter.

Don't show data notices in worksheet

I'm aware of data validations in Axlsx, however I'm not sure that's what I'm looking for here. I don't want to validate any data per se, but want any cell notices (in Excel here) to to be ignored.
For example, a notice I'm seeing on a couple of cells is:
The number in this cell is formatted as text or preceded by an apostrophe.
I tried doing something like this to select the whole worksheet and avoid showing any validation erros, however it didn't work for me:
sheet.add_data_validation("A1:H100", {
showErrorMessage: false
})
Can I use a Data validation to avoid displaying these notices in Excel?
This is one of the error checking options found in Excel Options ► Formulas ► Error checking rules ► Numbers formatted as text or preceded by an apostrophe. (or Alt+F,T,F then Alt+H)
To halt the display of these error control messages through VBA, run the following line of code.
Application.ErrorCheckingOptions.NumberAsText = False

App Inventor TinyWebDB List Problems

I got a problem using the TinyWebDB in App Inventor 2. Here's a Screenshot of the blockcode.
The goal of this Screen is to store a list(array) of images and later query them with a button but my problem starts already earlier. First there is a variable initialized called fotoList and declared as an empty list.
When this Screen initializes (left block) I store the empty fotoList under the tag FotoListTag. Then if the image under the tag "SteckbriefFoto" is not in this list -> getValue with tag "FotoListTag". Then he jumps into the block on the right and adds the photo .. other stuff not important .. at the end I store the list again in the TinyWebDB (and also in the TinyDB) with the tag "FotoListTag". Then it goes back to the block on the left where at the end I want to set an image.picture to the photo I stored in variable fotoList.
When I compile the code there is an error opening the page that says
Select list item: List index too large
Select list item: Attempt to get item number 1 of a list of length 0:()
I just don't get the problem with this code and i hope someone can help me.
For lists, valueIfTagNotThere should be create empty list instead of an empty string
On first run of your app, TinyDB is empty, which means, for tag = FotoListTag you get no value back, therefore this should be an empty list in the beginning.
Later you are trying to select the first item from the list (zahl is 1). As you know, the list is empty in the beginning, so probably you should add an if statement to check, if the list is not empty and only then select the first item... same for tag = Schriftlist.
You also have a timing issue. in Screen.Initialize you are trying to get a value from TinyWebDB. This is an asynchronous call, you get the result back in TinyWebDB.GotResult event and this takes a little bit (let's say 500 milliseconds), but meanwhile the complete blocks of the Screen.Initialize event will be executed. Probably you are expecting, that meanwhile tag = FotolistTag is not empty anymore, but this is not the case.

Drop-down validation list created dynamically

In range A1 I have a drop-down validation list. Based on the user's selection from that list I would like to dynamically create a new drop-down validation list in range C1.
For instance, in A1 the list contains:
A
B
C
So if the user selects A from the list, the new list in C1 contains:
1) Annoying Orange
2) Angry Birds
3) Arbitrary Sample
If the user selects B, the new list contains:
1) Bloated Code
2) Better Left Unsaid
3) Bad Attempt
etc
Easy enough to do using VBA. But in GAS.... I have absolutely no idea of how to even start :/
The Apps Script API for data validation was just released:
http://googleappsdeveloper.blogspot.com/2013/08/answering-another-top-request-data.html
You could follow the example in the accepted answer to Google spreadsheet Script Create Data Validation in certain range.
... up until last week, it would have worked. Unfortunately, the Data Validation class and related Range methods getDataValidation() and setDataValidation() have disappeared.
Your only avenue at this point is to visit Issue 2958 and star it, so you receive updates if & when the API is refreshed.

Resources