Querying Drive Labels

558 views
Skip to first unread message

Simon Smart

unread,
Sep 22, 2022, 8:49:36 AM9/22/22
to GAM for Google Workspace
Hi folks

I'm looking at some of the new functionality around Drive Labels and its looking great for querying around users...


I'm trying to wrap my head around targeting a Shared Drive instead of a user... in simple terms I would like to do the following:

for Shared Drive X, give me a list of files that have label Y

On a side note has anyone done anything interesting with the new Drive Label API yet?

Cheers
Simon

Ross Scroggs

unread,
Sep 22, 2022, 12:29:59 PM9/22/22
to google-ap...@googlegroups.com
Simon,

gam user us...@dfomain.com print filelist corpora allteamdrives  query "'labels/mRoha85IbwCRl490E00xGLvBsSbkwIiuZ6PRNNEbbFcb@79' in labels" fields id,name,driveid,mimetype showlabels details

I'll have to work on limiting it to one Shared Drive.


Ross


--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/f67c78a6-8936-4125-b4e6-4ca650a553aan%40googlegroups.com.


--

Simon Smart

unread,
Sep 23, 2022, 8:59:37 AM9/23/22
to GAM for Google Workspace
You continue to maintain ledge status sir!

TBH this will do me for now... I'll filter the results down!

Thanks Ross!
Si

Ross Scroggs

unread,
Sep 23, 2022, 7:31:04 PM9/23/22
to google-ap...@googlegroups.com
Simon,

You can do a single Shared Drive:
gam user us...@dfomain.com print filelist select teamdriveid <TeamDriveID> query "'labels/mRoha85IbwCRl490E00xGLvBsSbkwIiuZ6PRNNEbbFcb' in labels" fields id,name,driveid,mimetype showlabels details

Ross
--

Simon Smart

unread,
Oct 6, 2022, 8:57:12 AM10/6/22
to google-ap...@googlegroups.com
Hey Ross

Thanks for all your help with this so far. Is there any way to pull the human readable versions of the label values?

Cheers
Si

You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/hGz6g9-8XeI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CAJkvRS-wBX%2B6SAvZ%3D0L_RTHZ9FkLcnyykkUbd3O0ncx4xF2Jag%40mail.gmail.com.

Ross Scroggs

unread,
Oct 6, 2022, 8:58:29 AM10/6/22
to google-ap...@googlegroups.com
Simon,

Not with the current API.

Ross
----
Ross Scroggs



Ross Scroggs

unread,
Oct 6, 2022, 10:40:29 AM10/6/22
to google-ap...@googlegroups.com
Simon,

Send me a Meet/Zoom invitation.

Ross
--

Simon Smart

unread,
Oct 6, 2022, 11:17:05 AM10/6/22
to google-ap...@googlegroups.com
Hey Ross

Apologies I'm not available for a call at the moment.

I'm thinking I'll need to create a test document and then tweak the label values and then read them from the doc... rinse and repeat till I know all the IDs for all the possible label values. Unfortunately this won't help for say a number, free-text field or a person field which would contain an email...

Thoughts on this approach? It's a bit long winded but should get me most of the way there I think.

Reply all
Reply to author
Forward
0 new messages