Duplicates developer metadata when using cut + paste - google-sheets

I create Developer Metadata for each of the columns in the sheet.
If a new column gets created, I track it and create another developer metadata for it.
The process above works great until the user starts to move columns using Cut (cmd+x) and Paste (cmd+v).
When you cut and paste, the developer metadata is transferred to the destination column and as a result, you're ending with 2 metadata on the same column.
It gets more complicated when you do that process multiple times.
Eventually, I collect the changes and I see more than 1 metadata on a given column and I don't know which of them to choose.
Do you have an Idea how can I deal with that scenario?
The flow explained:
The user connect his google sheet document.
I go over his sheet and create metadata on the columns.
Name [444]
id [689]
Country [997]
Du
10
US
Re
30
US
The user is doing multiple changes on the sheet. One of the changes is cutting and pasting the column country over id. As a result, the column id gets removed but the metadata id we created stays on (Google Sheet API implementation)
Here is the new state:
Name [444]
Country [689, 997]
Du
US
Re
US
As you can see now, we have 2 metadata ids on the same column (Country). Why it is a problem for me? when I periodically collect the changes I recollect the metadata changes from the column. When I encounter two metadata ids on the same column I don't know which of them to choose.
So why can't I just select randomly? because I already have an existing mapping on my end and I don't know which of them to choose now. Take into account that the user may have changed the column name also so I can count on the column label.

Related

Google Sheets - Have working Tabs retain the entered information

I have a sheet that multiple people are working on, but only on certain rows in the sheet that they mark with their name. There is a master sheet where they are marking which ones they're working on, then a tab for each named person. The tab with their name gets populated using a "=QUERY(Master!A3:AX,"select * Where L='NAME'")". The goal of the tab is so they can work on their own stuff without having to scroll through the thousands of rows to find their next entry. Getting the info from the master to the tab is working fine, but when they are working on their tab, they add information to a few new columns at the end of the query. This is where my problem lies, when they go and tag another entry on the master as theirs, the columns they added information to already do not move with the entrys, they just get pushed up or down depending on the new entry placement.
Is there something I can do that will still pull in the data from the master sheet to the corresponding tab, but then keep what the staff is actually entering/working on, to remain in line with the entry that got pulled in? The whole process is sort of useless if their work is not retained as they are working through it.
For example, the query pulls in column A-L, then they are adding information to column M and N for the management to read and make decisions off of their input. I need the information they enter into column M and N to remain with the row the query originally pulled in. The master is sorted by a unique number in column A that needs to remain in that order, so they may add new entries randomly as they assign rows to themselves.

Collecting crowd-sourced data in tabular or spreadsheet format

Full disclosure: I originally posted this to the SE/Web application site but garnered zero comments amidst 15 views. Hoping for a better outcome here.
I'm involved in a citizen-science project polling recreational anglers about their preferred ocean fishing locations (lat-lon), a few characteristics about the location (depth, what species they catch, etc.), and some voluntary contact information. In spreadsheet form with each row being a unique location, there would be about 10 columns (each column being the response to a question).
I did a trial run with a small number of respondents using a Google Form that compiles all the responses to a Google Sheet, but due to limitations in Google Forms, respondents must submit a new form response for each fishing location they wish to provide. Every respondent said it was tedious and would prefer entering the data directly into a spreadsheet versus scrolling through 10 questions and submitting multiple forms to provide multiple locations.
Is there a process where I can distribute a link to potentially hundreds of people (who can in turn share that with whomever they wish) where the respondent is presented with an empty spreadsheet they populate with their responses? It would require that the field headers can't be edited and no one can see anyone else's responses. The spreadsheet would just look empty to each respondent. On the back end, the responses would be compiled into a single spreadsheet, much like how a Google Forms/Sheets works now. Google Forms is close - if they would just allow users to embed a Google Sheet in the form itself, I'd be set, but that's not possible at this time.
Edit - this is what the spreadsheet would include. Sorry I don't know how to properly embed or format this in tabular form. What each respondent would see is these column headers in a completely clean spreadsheet. They'd enter their data and submit, and on the back end, I'd have a master version of this that would append add each new location row-wise as they are submitted.
RowID | Latitude | Longitude | Target species 1 |Target species 2|Target species 3 | Habitat type| Home port | Name |Email address
click on this: https://docs.google.com/spreadsheets/create
copy-paste this fx in A1
=SPLIT("RowID|Latitude|Longitude|Target species 1|Target species 2|Target species 3|Habitat type|Home port|Name|Email address", "|")
copy the url
change edit#gid=0 to copy
take that URL and send it to your buddies and ask them to send you their URL of the sheet and enable sharing
or you can create those sheets for them and give to each of your people one spreadsheet
then create a new spreadsheet (master sheet) and use this in A2:
=QUERY({
IMPORTRANGE("url1"; "A2:J");
IMPORTRANGE("url2"; "A2:J");
IMPORTRANGE("url3"; "A2:J")}; "where Col1 is not null"; )

When using QUERY, how can I make it so that data moves together when using filter?

I am creating a tool for a video game I play.
Link to the example spreadsheet (Please make a copy to edit so that this copy stays intact for additional helpers).
Sheet 1 is “Choose Owned”. It contains a list of all of the champions available in the game and includes their attributes.
Column A contains checkboxes. Checking a checkbox indicates that the user owns that champion, and brings it to Sheet 2.
Sheet 2 is called “Owned”. It contains a list of the champions checked off in “Choose Owned” (aka the champions the user owns). “Owned” includes the champion attributes too, as first seen in “Choose Owned”.
Beyond those same attributes, “Owned” contains 8 additional columns.
These columns are from Columns G:N and are labeled ‘Level’, ‘Rank’,
‘Ascension Lvl’, and ‘Team Label(s)’ (‘Team Label(s)’ takes up
columns J:N). This data is all unique information and requires the
user to input the information themselves depending on their
champions.
Because there are so many champions, I want the user to be able to use the Filter function in “Owned” so they can easily locate the champion they need or sort the table however they wish.
However, because I use the QUERY function to get the data from “Choose Owned”, the Filter function tends to break. The most obvious error comes when you try to sort A-Z or Z-A; this simply cannot be done. I was fine with this, and have even included a note at the top telling the user to avoid sorting alphabetically.
Everything else works correctly until the user tries to add a new champion from “Choose Owned”. When the champion is added to “Owned”, the additional, unique data in columns G:N go out of order because they don’t move with their original champions.
Example:
I choose my champions. These champions are copied to “Owned”.
I pick their relative data in columns G:N.
A few days later, I obtain new champions and check them off in “Choose Owned” so they are added to “Owned”. However, when I do this, the champions stay in the same order as they are in “Choose Owned”, and columns G:N do not move with their champions so now, that information is with the wrong champion.
I want the additional data (G:N) to move with their champions when the table is edited due to champions being added. Or, in other words, I want those columns to stay linked to the first columns.
If there is a different way to achieve all of this like if I have to use a function other than QUERY, that is fine!
Please share any solutions you may have. I would prefer to not use a script but will consider the idea if it works.
this is a common issue within Google Sheets and it's solvable in 2 ways:
either by introducing a common value (unique ID) and then linking the manual input to query and aligning it by ID
or easier approach in your case - using timestamp/linear ID so every new entry would be added to the bottom and then the query would be sorted based on this order.

Linking several contacts to a single ID in Google Sheets or R

Update I added a link to a Google sheet and the column id like to know how to create
https://docs.google.com/spreadsheets/d/1oIqPf1OffpeCeMJW6kMJztT3mAWCLBPE7f8Ohr066wo/edit?usp=sharing
I need to analyze communications between different team members and users and need a way to combine different contact methods into a single identifier. I have a sheet that lists all the different contact methods for a single person (email, slack, phone), but not a way to link that to the sheet that keeps track of communication. Here's how the problem is set up.
The first sheet has the method of contact for each row. So, if the same person was contacted once by email and then by phone, the email would be in one row and the phone number would be in the second row (both listed in the same column).
The second sheet would have the contacts identifier (a unique ID), along with their name, phone, email, and other contact info.
How would I create a column in the first sheet that lists the unique identifier associated with any type of contact to that person?
So, for instance, the ideal solution would have something like this for hypothetical two people (the third row represents another person, the first two rows are the same person).
Col1 ID
email#name 4
555-555-5555 4
SecondPerson 5
I'm familiar with both R and google sheets, so can take solutions to create this in either. Or, I can import them into an Airtable if that helps.
I tried to look up solutions for record linking, but since all of the contact types are listed in the same column, I couldn't find a solution. Thanks and let me know if I can make the question more clear.
=ARRAYFORMULA(IFERROR(VLOOKUP(B2:B, {contacts!B2:B,contacts!A2:A;
contacts!C2:C,contacts!A2:A;
contacts!D2:D,contacts!A2:A}, 2, 0) ))

How to query data that's present in one tab, but not in another?

In Google Sheets, I have a sheet with three tabs. One tab for subscriptions (containing a name, in this case an unique username + date + some personal information), one tab for unsubscriptions (with the same username as in subscriptions) and one tab where I want to show all active subscriptions.
An active subscription is when the username is present in subscriptions, but not in unsubscriptions. There is a possibility that the same username subscribes again, in which case there are multiple entries in the two tabs. In that case, it's active when the subscriptiondate is more recent than the last unsub.
The structure for both sub & unsubs-tab are the same, except for the headertext (Sub.date vs Unsub.date for example).
I now have a query which returns all the subscriptions + information needed for the "Active subs" tab. I don't know where to start for the "filtering" with the Unsubs-tab..
I expect a Query-like output with all active subscriptions with the information from the subscriptionstab I need. The information is in different columns, so subscriptiondate, address and so on are located in for example column E & F, while the unique username is in column B.
Might need a little adjustment but seems worth a try, in a spare column:
=if(and(maxifs(E:E,B:B,B1)=E1,maxifs(E:E,B:B,B1)>maxifs(UnSub!E:E,UnSub!B:B,B1)),"Y",)
then select on the basis of the presence of 'Y'.
The logic is supposed to be:
Is this the row that contains the most recent subscription date for this individual AND
is this individual's most recent subscription date more recent than the most recent unsubscription date for this individual?
So could be shortened a little to:
=if(and(E1=maxifs(E:E,B:B,B1),E1>maxifs(UnSub!E:E,UnSub!B:B,B1)),"Y",)
Or:
Is this the most recent date for this individual across both sheets?

Resources