How can I use data validation in Google Sheets to keep two or more characters from being put in a cell? - validation

We have a google sheet UTM builder for our tracking URLs. One use case we've run into recently is some users are inputting reserved characters (like '?' or '&') into UTM values, causing trouble in the final URL string.
Google sheets does have data validation on a cell for 'text does not contain', but it appears to only apply to one value at a time, per cell. Is there a way to exclude a list of values without making it a dropdown?
Attempted to use data validation in Google sheets in various ways.

result of data validation (or conditional formatting) needs to be always boolean (TRUE / FALSE) therefore try custom formula:
=REGEXMATCH(A1; "[?&]")

Related

Google Sheets using checkboxes IF/FILTERING/REGEXMATCH in data validation "please enter a valid range"

I am using IF and checkboxes to make a sheet with a searchable data validation dropdown menu.
However, I'm getting the following error with my code.
Data validation error
The code I used is below. Originally I thought that the issue might have been that the nested IF statements were not returning series' thus the many ARRAYFORMULA commands. I have tried this without the ARRAYFORMULA commands I have tried this using IFS instead of IF.
=ARRAYFORMULA(
IF(M17,
FILTER(Traits!H2:H34, ARRAYFORMULA( REGEXMATCH(Traits!K2:K34, "Offensive"))),
ARRAYFORMULA(
IF(N17,
FILTER(Traits!H2:H34, ARRAYFORMULA( REGEXMATCH(Traits!K2:K34, "Defensive"))),
ARRAYFORMULA(
IF(O17,
FILTER(Traits!H2:H34, ARRAYFORMULA( REGEXMATCH(Traits!K2:K34, "Utility"))),
Traits!H2:H34
)
)
)
)
)
)
See sheet configuration
The sheets all are correctly named and all series return a value.
Additionally when I run the code outside of the data validation tool it functions.
Code Functioning Outside of Data Validation
The traits sheet
Not possible. google sheets data validation does not support advanced formulae in the adjacent field when criteria is set to list from a range. use your formula in some helper column (that can be hidden) or helper sheet (that can be also hidden)

Google Sheets data validation different for each row

For my current project, I'm making a sheet that lets me keep track of my D&D characters. I use data validation to remind me what all the options are for various stats, with the information being kept in a separate "RefTables" sheet. Creating a data validation for selecting a character class is very easy, since there are only 14 classes total. What I'm having trouble with is the 'subclass' column. After you choose the character class, you get to choose your specialization, or 'subclass'. This differs depending on the character class you chose.
Right now I can do the proper data validation for each cell individually. In my ref tables sheet, I have a section where it will grab the character class value and put all the 'subclass' options into a row. I can then use data validation in that specific cell to grab the subclass row. This works, but is tedious to do for every single cell.
The formula I would love to put in the range section is
=INDIRECT(CONCATENATE("RefTables!Q",ROW(),":AJ",ROW()))
which appends the row number with the appropriate columns so each row automatically gets its own subclass row (EX: RefTables!Q3:AJ3, RefTables!Q21:AJ21, etc.). I've seen solutions for Excel, but I'm using Google Sheets so I can share this document more easily with friends.
tldr; How to use data validation in Google Sheets that is slightly different for each row
unfortunately, this is possible to achieve only the manual way setting it up for every single cell/row. Google Sheets' Data validation does not support injecting CSVs via formula.

Use value of form control in a new record

Microsoft Access 2013 form with a value named FullSiteData built from this expression:
="50" & "-" & [IslandCode] & "-" & [QuadData] & "-" & [SiteData]
where IslandCode is a combobox and QuadData and SiteData are validated textboxes.
My question is how do I save the result of the expression into the Access table?
A textbox with data Control Source linked to the table field works, but I'd like to use the result of the expression builder instead.
I've built some web forms using PHP and MySQL and understand the process of a query adding data to a table, but don't really understand what Access is doing. Should I be looking at using the event properties?
If this is a matter of just adding new records to the database then you could use a Text Box bound to [FullSiteData] and have the After Update events of the controls for the constituent parts (Combo Box and two Text Boxes) update the .Value of the [FullSiteData] Text Box. When the record is saved that .Value will be written to the [FullSiteData] field.
If you will also be editing existing records then things get more messy because in the On Current event you'd have to split the existing [FullSiteData] into its parts and then set the values of the other controls to match. (Not so bad for the Text Boxes, but doing that for the Combo Box could be a bit of a nuisance.)
If the latter is a possibility then I recommend that you "bite the bullet", split the existing [FullSiteData] values into separate fields, and save those fields separately. Then you could convert [FullSiteData] to a Calculated field in the table (using the expression in your question) to minimize the impact on existing reports, etc.. (My guess is that most of them probably won't even notice...)

Display data using FILTER formula not working

I have this Google Sheets.
In sheet named Archive I have imported some tweets. In Sheet1 I have the following formula:
=FILTER('Archive'!A2:A;MMULT(SEARCH(TRANSPOSE(" "&A2:A&" ");" "&'Archive'!A2:A&" ");SIGN(ROW('Archive'!A2:A))))
What I would like to do is to display specific tweets from sheet Archive, containing specific keywords listed on Sheet1. This formula should work, but not in this case when I am importing data. All I get is a #N/A.
Am I doing something wrong?
As discussed on the sheet chat window, use:
=FILTER('Archive'!A2:A;MMULT(SEARCH(TRANSPOSE(" "&A2:A&" ");" "&TRIM('Archive'!A2:A)&" ");SIGN(ROW(A2:A))))
In short, the second argument of MMULT needs to have as many rows as there are columns in the first argument. Here is a spreadsheet that tries to describe MMULT used in this sort of way.
The TRIM part is to mitigate against spurious space characters that may be in the raw data.

Date Ranges in jqGrid Searches

We are using advanced search in the latest version of jqGrid, and our search dialog is configured to be always visible on the page above the grid. The structure of our data lists is dynamic. Thus, when we are going to display a list, we first do an ajax call to get the list of columns for the grid. We then construct the data model for the grid and make a request for the data.
Currently, in the request to get the columns, we return the data type of the column. If the data is a date, we display a date picker in the search form. However, some of our customers HATE having to use <= >= for date ranges. They want to be able to pick a date column and then set a start and end date using two side-by-side date pickers. I've been pushing them off for a while now because they have the ability to do date range searches, but the complaining isn't stopping. (It's more clicks to add the second filter with the end date)
Is there any way I can modify jqGrid to give me a date range control when I am configuring a search on a date column? I really don't want to have to set up an external search dialog UI just to deal with these complaints, but product-management is pushing really hard to get "normal" date ranges for the grids.
You can create your own custom search dialog. See this question which I asked couple days ago.
using setGridParam to change your postData array and include extra values in the filters JSON object that will be carried over to your server side where you can dissect it. In your case you can pass over your data range Start and End inside the filter item of the postData. Then reload your jqGrid like this
var $grid = $("#list');
//$grid.setGridParam({datatype:'json', page:1}).trigger('reloadGrid');
var post_data = {searchField:'',searchString:'', searchOper:'',
filters:'{"groupOp":"OR","rules":['+
'{"field":"Date","op":"ge","data":"2012-04-23"},'+
'{"field":"Date","op":"lt","data":"2012-04-25"}' +
']}'
};
$grid.setGridParam({postData:post_data}).trigger('reloadGrid');
The above will save the postData array with the new config and the reloadGrid sends a request to the server with the new postData array. This will preserve the paging as well; however, to get the old view of your grid (without search terms) you need to implement the reset button separately too and trigger reloadGrid after that for this to take effect.
Not sure if you have solved your problem by now; however, I am putting this solution here for any one from the future who has the same issue.
As far I know there is no way to do this, but to write it yourself.
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_searching
Filter jqGrid Data by Date Range?

Resources