Is there a way to create nested label under inbox? - gmail-api

I tried from gmail.com UI, but i didn't found any way to create nested folders under system labels.
Then i tried using APIs and it's not possible from there also.
But i am not able to find any documentation where this behaviour is specified. Am i missing something or doing something wrong.
I am using gmail apis to create labels. https://developers.google.com/gmail/api/v1/reference/users/labels/create
The problem is we have a customer who has nested labels under inbox. I think may be its old gmail feature and does not exists anymore. Can someone clear my understanding. Thanks in advance

It appears that USER labels cannot currently be nested under SYSTEM labels with the Gmail API. I'm not sure if they could have been at a point in the past using the Gmail API or another deprecated API. Finding information to indicate it was possible in the past may be difficult as the older "offical" APIs such as the Email Migration v2 API (and its predecessor) appear to have had there documentation taken down.
Maybe #Rubén is onto something here. Though I would assume that Google's servers in their current configuration would return some sort of error while attempting this from any client. It is probably deprecated functionality that has since been removed that made this possible. Maybe when using the old obsolete Email Migration v2 API this was possible. I unfortunately cannot recall/prove if it allowed said functionality.
I cannot find a link with information directly from Google. However, I have found the following:
ScottG_TC said: "You are creating a new Label, did you check off Nest Under and then the drop down will show you all of the user created lables. Those are the only ones you can nest under."
https://productforums.google.com/forum/#!topic/gmail/DqWSicdPTSs
ScottG_TC said: "You can not nest labels in Inbox."
https://productforums.google.com/forum/#!topic/inbox/78TdouDE0s4
Gmail API
Having used the .NET wrapper/version of the API I have noticed that I cannot create a nested label under the 'Inbox' SYSTEM label programmatically. Attempting to do so produces the same result as using the GUI. It creates a flat USER defined label named 'Inbox/Foo'. This appears to be the standard result of attempting to create a nested USER label under a SYSTEM label. That is, a flat USER defined label will be created independent of the intended SYSTEM label.
Gmail
Example using the Gmail UI itself.
And after creation.
As I'm sure you've already noticed in the UI using the "Nest label under:" has no option to specify any of the SYSTEM labels.
Creation of a USER defined label using the name of a SYSTEM label is also invalid.
"Duplicate Question"
Regarding this
I don't believe this is a duplicate question, the Gmail API has the concept of USER and SYSTEM labels. The provided duplicate question/answer only goes over the idea of creating a nested label under a USER defined label. It does not state whether or not a nested label can be created under a SYSTEM label such as 'Inbox'
Difference between USER and SYSTEM labels:
https://developers.google.com/gmail/api/guides/labels
The difference can also be observed by going to https://mail.google.com/mail/u/0/#settings/labels SYSTEM labels have there own section.

I was able to accomplish this by linking my gmail account to windows 10 "mail" program. Then used the windows mail UI to create my nested folders under my inbox then when I go back to gmail using chrome ::boom:: nested under my inbox.

Related

Access questions programmatically? [duplicate]

I would like to (programmatically) convert a text file with questions to a Google form. I want to specify the questions and the questiontypes and their options. Example: the questiontype scale should go from 1 to 7 and should have the label 'not important' for 1 and 'very important' for 7.
I was looking into the Google Spreadsheet API but did not see a solution.
(The Google form API at http://code.lancepollard.com/introducing-the-google-form-api is not an answer to this question)
Google released API for this: https://developers.google.com/apps-script/reference/forms/
This service allows scripts to create, access, and modify Google Forms.
Until Google satisfies this feature request (star the feature on Google's site if you want to vote for it), you could try a non-API approach.
iMacros allows you to record, modify and play back macros that control your web browser. My experiments with Google Drive showed that the basic version (without DirectScreen technology) doesn't record macros properly. I tried it with both the plugin for IE (basic and advanced click mode) and Chrome (the latter has limited iMacro support). FYI, I was able to get iMacros IE plug-in to create questions on mentimeter.com, but the macro recorder gets some input fields wrong (which requires hacking of the macro, double-checking the ATTR= of the TAG commands with the 'Inspect element' feature of Chrome, for example).
Assuming that you can get the TAG commands to produce clicks in the right places in Google Drive, the approach is that you basically write (ideally record) a macro, going through the steps you need to create the form as you would using a browser. Then the macro can be edited (you can use variables in iMacros, get the question/questiontype data from a CSV or user-input dialogs, etc.). Looping in iMacros is crude, however. There's no EOF for a CSV (you basically have to know how many lines are in the file and hard-code the loop in your macro).
There's a way to integrate iMacro calls with VB, etc., but I'm not sure if it's possible with the free versions. There's another angle where you generate code (Javascript) from a macro, and then modify it from there.
Of course, all of these things are more fragile than an API approach long-term. Google could change its presentation layer and it will break your macros.
Seems like Apps Script now has a REST API and SDK's for it. Through Apps Script you can generate Google Forms. This API was really hard to find by trying to google for it and I haven't yet tested it myself, but I am going to build something with it today (hopefully). So far everything looks good.
EDIT: Seems like the REST API I am using works very well for fully automated usage.
In March(2022) google released REST API for google form. API allows basic crud operation & also added support for registering watches on the form to notify whenever either form is updated or a new response is received.
As of now (March 2016), Google Forms APIs allow us to create forms and store them in Google Drive. However, Forms APIs do not allow one programmatically modify the form (such as modify content, add or delete questions, pre-filled data, etc). In other words, the form is static. In order to serve custom, external APIs are needed.

How to do a search & replace of Link Properties within a PDF using Adobe Acrobat XI Pro

I am attempting to find an elegant solution to an issue for another department within my agency, and I am hoping somebody can provide me with a path to discovering the right solution.
The problem: The user currently has large number of links which (A) deliver the user to a page within the document, and then (B) open a web link. The Link Properties are currently as follows:
There are a large number of links within this document which point to the same place (frustratingly, this is simply how they've decided to do it, and there is no swaying them in that regard), and many times, the text pointing to the link is different (i.e. "visit this link" and "refer to form 10-a for more info" both point to the same URL).
What I would like to do for them is provide them with some sort of search & replace function, or a batch process of some kind, which will search the link properties for all existing links in any given document, allow them to input the currently existing URL, and replace it with another URL of their choice. As it currently stands, they must edit each link manually, which poorly impacts their manhours.
I have been all through Adobe's help materials, and while I found them to be useful in other tasks I might wish to do, I'm not seeing a way to specifically address the issue of searching and replacing Actions within a Link Properties. I would be rather surprised if this was not something that Adobe will allow me to do, and I am fairly certain I'm simply not finding a way to articulate my need in a search engine friendly way that will find what I am looking for.
One caveat: if no solution exists within Adobe itself, a third party tool is not an option. I work for a government agency, so nifty third party tools are strictly forbidden.
With Adobe Acrobat and only Acrobat, assuming that 3rd party plugins have the same restrictions as other software, the only API you have at your disposal is Acrobat JavaScript and unfortunately, JavaScript can't interrogate the link to find it's properties, it can only set them or reset them.

Find where and how objects are used in Salesforce.com

I have recently taken up salesforce.com and i have very little idea about its workings and stuff. Recently i was going through some of the stuff and i had a doubt...
Is there any way through which i can find out where an particular field/ object/ visualforce page has been used in an application. For example lets say i have a field labeled Sales, i want to be able to find where that particular field is used, under which object, and the object in which visualforce page/ Apex class, and the visualforce page/ Apex class is used in which application.
Hope i have made my Q clear.
Thanking everyone for their help
It's not really a programming question, you might be better off asking about administrative stuff like that on salesforce.stackexchange.com.
If you have a test environment (sandbox) - you could always try deleting the field there ;) I'm kidding but if you'll try it the page should display you a list where the field is being used.
Similar thing could be achieved by creating a changeset, adding that field to it and then checking dependencies.
But probably the best way would require some preparations upfront. Read about Force.com IDE (or Eclipse IDE) and how to use it to download files that represent your object definitions, page layouts, classes, visualforce pages, reports... This is great as backup but also will let you search the files (Ctrl+H in Eclipse or just use whatever you want once you have the files locally). Search for API name of the field (similar to My_Custom_Field__c should be most effective.
Pretty old thread but adding another option. I have a free and open source app that scans the fields in your Org and returns the components it's used in (Workflows, Processes, Page Layouts, Apex etc).
Keep in mind that returning fields in Apex and VF is not 100% accurate, as a field with the same API name on different objects would return as being found in a class, even though it might not (as others have mentioned).
Also, it can take quite a while to run on large Orgs.
App: http://schemalister.herokuapp.com/
Source Code: https://github.com/benedwards44/schemalister

How to pass email body to an application

I have recently discovered that you can make rules in Outlook. These can be triggered by a number of events and do a number of things. One such thing is launching an application.
Seeing this, I thought I might be able to automate a few emails. However, some of these processes will likely require information in the body of the email, which I have no idea how to pass into the application.
Is there a way I can pass the email body of the message that triggered the event into the application being launched?
Note: I'm using Outlook 2003 on XP
It may be possible to pass information as parameters to your script. But that would mean lots of rules with static information being passed based on the email subjects. Without using anything besides outlook itself and an external batch script, it does not seem possible to pass elements of the email to the script. But I hate to say 'impossible'.
There are some really cool things that can be done with outlook and more advanced languages though :-).
Edit: Live and learn. It is possible with vb.

Should we create custom pages for all objects?

I noticed that salesforce doesn't allow to override control function for all objects.
Say if you want to do something whenever objects get saved there is no way to attach the action
unless you create a custom page and include either standard controller or extension. Or if you want
to add the same meta-tag on all pages I run into this limitation. Is there better way to do this?
Generally - no. Roughly speaking if Salesforce doesn't allow you to do something it usually means there's pretty good hint you're doing in it wrong. I realize it sounds like I'm a fanboy but in reality - can you expand your question with concrete example why would you want to do something like that? For example governor limits are evil, annoying etc. - but they force you to write effective code that doesn't strain the database too much.
if you want to do something whenever objects get saved
That's what triggers are for. Ask yourself a question if the "action" you need to make should happen only from web UI or also when performed from API (mass data load, a smartphone application etc).
if you want to add the same meta-tag on all pages
You could maybe pull off similar result by adding a component to the sidebar. It won't cover all cases (like accessing Reports/Dashboards) but it's hard to say more without knowing what you're really after. Then again - custom VF page overrides won't help you when it comes to Reports either.
I wanted to add this as a comment, but was unable to.
Anyways, For the example that you mentioned in the comment, You can add that jQuery plugin in the Home page side bar component and activate the plugin only on those custom objects where you wnat to run this plugin. You might already know that we can deduce which object a record belongs to by looking at the 1st 3 letter of the record Id, using this logic, check if the record belongs to the custom object you want your plugin to act on and run the plugin.
But As eyescream has pointed out adding script in side bar has its own limitations: you cannot use the global variables , side bar components are not loaded on the reports and dashboard tabs etc.
-ಸಮಿರ್

Resources