Hide author email address from Google Sheets API - google-api

Google Sheets allows publishing any spreadsheet to web. Doing so exposes the data contained in the published spreadsheet for access via variety of APIs, such as Google Sheets API.
This is all fined and good, except for one thing. Accessing the a published worksheet via API, returns email addresses of the users who have contributed to that worksheet.
For example a request like this:
https://spreadsheets.google.com/feeds/cells/[key]/[sheetId]/public/basic?alt=json
Among other information, will also return this:
"author": [ {
"name": {
"$t": "***"
},
"email": {
"$t": "***#***.com"
}
} ],
The *** in the above snippet are real Google account names and emails.
Is there a way, either via document properties or via generic Google Account properties, to disable publishing of your email address via public APIs?

There is no way to hide that information in that spreadsheet.
However, here is a workarround:
copy the sheet contents to another spreadsheet, and publish that other spreadsheet. Copying can be done several ways:
You can make a manual copy, which will preserve everything including images, but is harder to maintain in sync.
use the =ImportRange formula to import values automatically into the copy. that handles changes but doesnt handle all formatting and wont work if images change (unless they are placed using =image formula).
=IMPORTRANGE("1z5afM6Wn-8RKsdUpTPicU0d81YCWX4bqzgKIna1uep0","Instructions!A1:E") for example will copy all content in columns A to E into your sheet.
In the published sheet make that "File:Spreadsheet settings" is set to "Recalculation: on change and every minute".
A more detailed example of using importRange is in this blogpost I made, see the part about importRange to copy the "instructions" sheet to other sheets: http://zigmandel.blogspot.com/2015/09/how-i-crowd-translated-my-product-tour.html
3. have an apps script with a trigger to copy the entire sheets into the published spreadsheet. that will preserve everything but is a little more code to delete the old sheets and copy the new ones over.
And of course, the email you use for making those copies (manually or by script) needs be one you don't mind publishing.

Related

Power Automate: Send eMail mit Sharepoint attachement

I have a problem creating a flow. All files for the flow are in a sharepoint. In an Excel list, I call up various information such as name, surname, e-mail and also the file name of the e-mail attachment. The e-mail attachment is also stored on the Sharepoint in a different underlying folder. How do I include the attachment in the flow?
The whole flow works fine. However, when I let the attach file be selected dynamically like,
the flow runs into an error:
Without a dynamic attachment (hard coded) it runs through without error:
Here the eMail result - hard coded attachement:
Any idea how to select the attachment dynamicaly?
Thank you very much for your help.
Kind regards
Andi
You'll want to use this specific action ...
... there are two and the one I have shown is the one you'll need to use.

Copy one slide from a google presentation into a new google presentation using API [duplicate]

I wish to use Google Drive API for creating a new Google Slides, but with one slide copied from another previous presentation.
My question is, is that possible to build a new Google Slides and insert slides (singularly) into the new one.
Or is it possible to delete the a slide from Google Presentation?
Although imperfect, you may be able to get close using the new Google Slides API. You can read the slide from the source presentation and then attempt to replicate it in the destination presentation. At the moment not all Slides features are supported in the API, so there may be some information loss is the process.
(Feb 2017) As of Nov 2016 with the release of the Google Slides API, an alternative to the solution the OP is asking for is now possible although not directly with the API. That workaround is that the ONE SLIDE you want copied is in its own standalone file. Then you can use two Google APIs to make it happen: the Slides API (to perform the document-level functions like adding new slides) as well as the Google Drive API (for file-oriented access like copying).
Sounds like you're using the Google APIs Client Library for Ruby, so you're set there. The next step is to create a project in the Google Developers Console with both the Google Drive and Google Slides APIs enabled, then download the client_secret*.json file after you create your OAuth2 credentials.
To help you get started, here's the Ruby quickstart sample for the Drive API, and here's the Ruby quickstart for the Slides API. If you're not "allergic" to Python (if you are, just pretend it's pseudocode ;) ), I've made several videos with more "real-world" examples of using the Slides API you can learn from and migrate to Ruby if desired.
Below is another Python example which you can port to Ruby that does exactly what the OP asked, assuming your template file is SLIDE_TEMPLATE_FILE, DRIVE is your Drive API service endpoint, and SLIDES is the endpoint for the Slides API. If someone PMs me a Ruby port, I'll update this answer with it.
# query for template file with one slide
TMPLFILE = SLIDE_TEMPLATE_FILE
rsp = DRIVE.files().list(q="name='%s'" % TMPLFILE).execute().get('files')[0]
# copy template file
DATA = {'name': 'Google Drive & Slides API template DEMO'}
DECK_ID = DRIVE.files().copy(body=DATA, fileId=rsp['id']).execute().get('id')
# create 2 more (1 title-only & 1 blank) slides in copied file
reqs = [
{'createSlide': {'slideLayoutReference': {'predefinedLayout': 'TITLE_ONLY'}}},
{'createSlide': {'slideLayoutReference': {'predefinedLayout': 'BLANK'}}},
]
SLIDES.presentations().batchUpdate(body={'requests': reqs},
presentationId=DECK_ID).execute()
Finally, yes, you can also delete slides from presentations with the deleteObject request, passing in the ID of the slide/page you want removed. Another workaround if you can't isolate the ONE SLIDE: copy the entire presentation & delete all pages except the ONE SLIDE, then start adding new slides. Hopefully the API will eventually get "the right solution" so we don't have to play these games.
It is not possible from the API to perform this complete operation from API.
Although, we can create new or copy existing Google Presentation.
Or, we can do that from browser interaction by ctrl+c one slide and ctrl+v into another one.

In strapi what are api templates for?

I've started playing with strapi to see what it can do.
When generating an api through strapi studio, it generates a set of base files to handle the model and api calls.
In the entity folder (e.g. article), there's a templates/default folder created with a default template. For an article entity, I get a ArticleDefault.template.json file with this:
{
"default": {
"attributes": {
"title": {},
"content": {}
},
"displayedAttribute": "title"
}
}
In strapi studio I also then add additional templates for each entity, given it multiple templates.
The command line api generator does not create the templates folder.
I couldn't find anything about it in the documentation I read.
What are the generated templates for?
When would I use them, and how would I choose a particular template if I have multiple?
I'm one of the authors of Strapi.
A template is like a schema of data. Let’s take a simple example. You have an API called Post, sometimes your post have a title and a content attribute, but other times, your post have a title, a subtitle, a cover and a content attribute. In both cases, we’re talking about the same API Post but your schema of data is different. That’s why we implemented the templates! Your needs could be different for the same content.
Then, as you said the CLI doesn't generate a template folder in project. The Studio doesn't use the same generator as the CLI but the behavior of your API is the same.

Upload .csv Data to specific sheet of a Google Sheet using PyDrive

So far I've managed to make a python script using PyDrive to a new Google Sheet, using:
myfile = drive.CreateFile({
"id": "IDHERE"
})
myfile.SetContentFile('FILENAME.csv')
myfile.Upload()
However, ideally I'd like to be able to specify not only the spreadsheet ID to upload to, but the GID of the specific sheet in the spreadsheet to add the information to.
Does anyone know if this is possible?

Programatically retrieve an attachment stored on a note on a CRM 4.0 entity

How would you suggest working with files that is stored on the note of a entity in Crm. Could you write a generic method that will enable you to access any type of file? Or would it be better to have a method for dealing with each type of file?
For example, we are going to be saving a mix of swf files and xml files on the entity, so would it make sense to have a method each for example:
GetXmlFilesOnAccount(accountid)
GetSwfFilesOnAccount(accountid)
When you upload an attachment to CRM the mimetype is also saved as part of the record information.
The following link contains a nice example of how to download the attachemt using a single method. http://crmscape.blogspot.com/2009/10/ms-crm-40-sending-attachments-to.html
The post is missing the actual query needed to retrieve the annotations but you can tell what columns are required from the method signature.
My suggestion using your methods:
* GetXmlFilesOnAccount(accountid)
* GetSwfFilesOnAccount(accountid)
Retrieve account activitypointers by regardingobjectid(in your case accountid guid)
Loop through returned activitypointers
Get attachments for each activitypointer (activitypointer.activityid = activitymimeattachment.activityid)
Store attachments (disk, etc)
You don't even need two methods. You can retrieve all attachment file types for a given note (annotation) with a single method.
Hope this helps.
I recently started an Open Source Project on CodePlex to accomplish exactly that. Feel free to check out the Project's Web Page at:
http://crmattachdownload.codeplex.com/
You can also view the source code under the "Source Code" tab of that same page.
Pete

Resources