Insert country official language based on a country name in a column - scripting

I have a form that feeds a spreadsheet (from "jotforms", not google form) and I have in column D a list of Countries (only country name) and I need to insert the official language somewhow for each country in another Column (lets say column U) on form submission. (meaning each time a new row is added).
I need the language to be displayed full text, not codes like "fr, spa, eng, etc." I want it to say English, Spanish, French, etc. Full words.
I Need the script or formula to work only in the sheet "Members Registration".
Is this possible?

I can think of two ways to do this.
In Jotform, make one empty hidden question that will be the Language column in your Google Sheet. Then make one hidden read-only question per language, with the full language name as the default value.
Lastly, in Settings make a Conditional action; if the country selection is this or that, copy value from the right language holder to the empty Language question. Language column is then filled out automatically depending on country choice.
The other way would be to add a column in your gsheet for Language and use a VLOOKUP formula on the whole column to a new tab in your gsheet. If your country code is in column D and the country-to-language reference is in Tab2, use:
If(isblank(D2),"",vlookup(D2, Tab2!A:B,2))
The formula column won't be cleared by new form submissions.

Related

Show a name instead of an id

I currently have these options set in a combo box:
This box will show the projectIDs that a current company has which is set with the criteria. I just want to show the name of the project as people will not know just by the id. If I remove the check box for the projectID it will just remove that field completly and not show anything. I have debugged what companyBox.Value is and it is indeed a number for a company and if taken this id and replaced it with the following query which is built from the picture and it returns the results I want. I just cant get the values to show in the combo box.
SELECT projects.projectName
FROM companys INNER JOIN projects ON companys.companyID = projects.companyID
WHERE (((companys.companyID)=7));
Gives me all the projectNames where the companyID is 7
And as seen below that same query just gives me blank spaces instead of the names:
Ok, if you have say a query, then as noted, then you can use a "join" to pull in the other table (based on that "projectID").
So, for a general report etc., then your approach of using the query you have is correct.
HOWEVER!!!
For a combo box? They have this feature and ability built in. In other words you do NOT in general need a join.
The combo box has two parts:
A sql query that "drives" or "fills" the combo box. This can (and will be) of course based on the Projects table.
VERY important:
Our combo box is to save, store, put, use the project ID into a column in our CURRENT form. That form of course is based on a differnt table (the forms current table). So, keep in mind the two concpets:
Combo box can be driven by any table to display data.
Combo box will/can use a column from that "other" table to SAVE into a current column on the current form.
Now of course the Project "id" is the VALUE we want, but we sure as don't want to display that "project id" value, since as you note, humans want the nice looking text.
First Rule:
ALWAYS, but ALWAYS make sure the FIRST column of the combo box "sql query" is the column we WANT to save into the current form, but ALSO the column we are going to HIDE AND NOT show to the user.
So, a combo box can with great ease HIDE the first column. You can hide other columns, but as a general rule a VERY HIGH number of my combo boxs will have two columns. So, you might need company "id", but would want to display company name as nice text to the user, but store/save/use the "id" of company for this purpose.
So, in your case? Change the order of your columns.
You want:
ProjectID, ProjectName, and you ALSO can continue to have a filter based on company.
So, once you get above setup, and you WILL NOT need a sql join. Remember, the combo box has it own "whole sql statement" based on table projects.
So, the combo box will:
Save/store/use the ProjectID when you select a project.
And it will display the project name, but behind the scenes it will use + save ProjectID.
So, just make sure that you set the length of the first column in the combo box to 0 (to hide that projectID from display).
Next, make sure you set WHICH column value from the query the combo box is to save.
That column will be the FIRST column, so you want to set that to 1
Your combo settings will look something like this:
In above, the CONTROL source is your CURRENT form and table.
So, I want to get a Hotel "ID" from the table hotels, but I am going to save the results of the combo box selection INTO a column called Hotel_ID
And note VERY careful - I set the bound column = 1 (that is the FIRST value from the query that drives the combo box.
Next up:
We want to hide the first column value, so you need this setting in format tab of the property sheet for the combo box:
NOTE VERY close in above. I set the FIRST column width = 0. this is HOW you hide the "ID" of hotels - I only want the user to see the nice hotel name. (or in your case Project name).
But, the 2nd column, I have a width for the Hotel name (or in your case project name).
So, make your first column in the query for the combo box the "id" of project id. Set the width of the first column = 0.
So, the query that drives the combo box? It is based on the ONE table, but you need to ensure that the "id" that you going to use is the first column, and simple hide it from display.
So, a combo box has a sql query that drives the combo box, and that query in most cases will NOT be the current table.
So, you have to set BOTH settings (the column the combo sql query will use - but to avoid confusing, then just adopt the habit of making the 1st column the "id" or value you want from that sql.
But, after setting above, you STILL have to set what column to shove/put that column into on the current form. (that setting is the control source).
In effect, a combo box is a kind of look-up into the other table, and it can display nice user friendly text columns, but still use + store the ID.
So, your query should look more like this:
SELECT ID, projectName
FROM projects
WHERE (((companys.companyID)=7));
I don't know if your first column of Projects table is "ID" (or is it ProjectID), but as you can see, the combo box ONLY needs to be based on the one table, and with our new rule - we always use the first column of the query the "id" value we want.
Now, of course the above is "hard coded" for company, and your original query that drives the combo box was fine - just that the order of the columns display was incorrect.

VBA For Auto Fill

I want to be able to choose a value in E4 on the Invoice (which must have a drop down list of Client ID, Then I want the Client Name to populate into B5 the client address into B6, The vat number into B7, Terms into E6
All the info must come from the Customer sheet as shown in the picture
Column A: Client no (ID100)
Column B: Client Name
Column C: Client Address
Column D: Vat No
Column E : Terms
I have tried everything but I cant seem to get it right, My knowledge is limited but I did write the invoice program....with help from the internet
Customer list:
Invoice:
This is deceptively simple if you stretch the boundaries of your preferred solution a little bit. Instead of entering data in E4, use a combo box. Set the source row as the ID100 column. - Your ID Column only lists unique IDs with no duplicates right?
If there are duplicates in the ID field then you have three choices.
Overhaul the table and clean your data
Take a day or week or a weekday to really think about how you want select and/or display the extra information and handle the that you'll encounter complexities
3 Give the project to someone else
I recommend the combobox because
The combo box can intellitype/autofill as you type
The autofill perk doesn't misspell, or display anything that isn't in that column that means any lookup is a guaranteed return if the user is not being a dill
You aren't looking anything up until the ID is populated so this control acts as an um..... well.... control. It's a great starting trigger.
using the combobox results you simply use your favorite lookup to get the row number (vlookup, match, find, filter, you get the point)
now grab the values from the community you need and populate the cells.
Done! Easy right?

How to reference a specific cell location within a changing table

I am not sure how, if at all, this can be done. Basically I have a report that is generated from SalesForce for some co-workers. It exports to Excel in this nice little table. Depending on their team, they filter the results and then filter the month (fiscal year in this case).
What I want to do is have text populate at the top which is based on the text that is in the first cell in the column C (not including header row of course) when they filter. How do I go about referencing the spot where C4 is currently when they select Team "White-1" and Fiscal Year "Aug"? That cell will become hidden and I will need to pull the data from C6 which HAPPENS to be in the location that C4 was just in before being hidden.
Here is an image of the report in Excel as well as the "location" that I want to reference no matter the filtering that the employee does:
Report
I assume VBA will be needed. Preferably I want to generate the text in A1
If you are ok with adding a "Helper Column" you can do the following to get the results you are wanting:
Add a column between B and C Give it a header of some kind I used "Helper". Then in this new Column use use the formula =Row() to generate a number for each row.
You can hide this column now if you want.
Then in whichever cell you want the answer you seek enter the following formula:
=Vlookup(Aggregate(5,5,C:C),C:D,2,false)
Now you can filter all you want and you should get the result you wanted.

Text Manipulation nestled within a Query (Or ArrayFormula) (Google Sheets)

I'm trying to Query some data in my spreadsheet, returning a manufacturer based on product code. We code our products with a three digit suffix that corresponds to different customers. I know the codes but people viewing the sheet may not.
Right now, I'm trying to split the suffix from the product and perform the wuery in the same formula.
I can do this in two steps, splitting the suffix from the code and querying just the suffix, but I want to know if I can do this all in one code. My current formula returns the data I want but it does not fill the entire range of the sheet. I would rather have this happen automatically as the workbook will be dynamic.
My current formula is:
=QUERY(CxSeries,"select B where C CONTAINS '"&right(Code,3)&"' ")
https://docs.google.com/spreadsheets/d/190kom4q0XOJP4UdLTJpZf5tuJCQTflcuokRp_FJ4pBc/edit?usp=sharing
I'm not sure if query is the right way to go about this, but I'd prefer to stick to that (just because i honestly can't wrap my head around ArrayForumlas).
Thank you,
Clear all formulas you have in column C and enter in C7
=ArrayFormula(vlookup(regexextract(D7:D16,"-(\d+)$")+0, {Sheet5!C6:C,Sheet5!B6:B}, 2, 0))

VBA - How to fill the data to specific column by referred to another column on the same sheet

How can I automatically fill data into a specific column by referring to a different source-column on the same sheet?
Example:
In the source column are the numbers 1 to 10. How can I convert this into e.g. having "1" displayed as "One" in the second column?
If you just want to spell the number in the first column, then:-
Setup your column headers and format the area as a table (From Ribbon -> "Home" => "Format as Table").
Using the instructions from this Microsoft Support article (https://support.microsoft.com/en-us/kb/213360/en-us), add the code from the article into a VBA Module in the workbook.
Assuming your first data cell is "A2", add this formula to cell "B2":- =SpellNumber(A2). Since it is a table, the formula will be propagated down that entire column automatically, even when adding new rows.
You will need to modify the code from the MS Support article, as it is designed for returning Dollars & Cents phrases.
without know that you really want, You can see convert a numeric value into English words in Excel
PS: joehanna sorry, I'm not saw your answer