i was wondering if i can get the new emails data and put it in a spreadsheet .. the reason i'm making this is i need to track response time with custom search criteria like "FROM:(example#ie.com OR example#ie.com OR example#ie.com) ("done" OR "file") has:attachment".
and if the search have a new email i need to return it to a new row in the sheet within functions for the required ranges.
Here is a link that describe what i need to do
https://docs.google.com/spreadsheets/d/1oRrB8JSR1lVHGhjBd5-BU9XxkuaBZPG_MwVq5uEiioE/edit?usp=sharing
Appreciated
You can use GmailApp.search('Your_serach_criteria'). This will return an array of Gmail Threads which then you can iterate for messages and extract the required information and put in spreadsheet.
Related
I am try to add autocomplete list email in my function. Right now, i key in the email address manually, so i have to write or copy all. it should be more efficient if the there autocomplete feature. Here is my code sample:
function getemail(){
var ui_user = SpreadsheetApp.getUi();
var result = ui_user.prompt("Enter Receiver Email:");
return result.getResponseText();
}
is GAS can search our contacts email address then query it all?
Yes, Google Apps Script could be used to search for contacts by using the Contacts Service but it's not possible to add autocomplete feature the Spreadsheet.Ui.prompt. In order to have that feature you will have to create a dialog by using HTML Service, client side code (HTML/CSS/JavaScript) and communicate this code with server code.
I'm trying to connect Google Sheets to JIRA to gather the data for updating reports automatically.
I'm struggling however with a couple of points in this modified script.
I want to return the component field but calling the name field returns undefined.
var components = data["issues"][id].fields.components.name;
If I remove the name field, then I get the following response:
{name=#####, self=https://www.#########/rest/api/2/component/26357, id=26357}
The second issue is that only a handful of issues are being rendered. As far as I can see my REST call looks OK, as does the writing to tables:
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); //select active spreadsheet
sheet.getRange(2, 1, issuessss.length, 7).setValues(issuessss); // write from cell A2
break;
Anyone have any ideas that could help?
The field component is an array so components.name does not exist (i.e components[0].name would work).
Before setting the values, try to execute a flush first.
I need some help in understanding what to do next.
I need to write a web based search function to find medical records from an XML file.
The operator can enter either part or all of a patient name and Hit Search on the JSP web page.
The server is suppose to then return a list of possible patient names with the opportunity for the operator to go to next page until a possible patient is found. They can then select the person and view more details.
On the Server side
I have an XML file with about 100,000 records. There are five different types of records in the file. (This is roughly about 20,000 x 5 = 100,000).
I have a java class to source the xml file and create a DOM to traverse the data elements found on the file.
-- XML File Begin
100k - XML file outline
<hospital>
<infant key="infant/0002DC15" diagtype="general entry" mdate="2015-02-18">
<patient>James Holt</patient>
<physician>Michael Cheng</physician>
<physician>David Long</physician>
<diagnosisCode>IDC9</diagnosisCode>
..
</infant>
<injury key="injury/0002IC15" diagtype="general entry" mdate="2015-03-14">
<patient>Sara Lee</patient>
<physician>Michael Cheng</physician>
<diagnosisCode>IEC9</diagnosisCode>
..
</injury>
<terminal key="terminal/00X2IC15" diagtype="terminal entry" mdate="2015-05-14">
<patient>Jason Man</patient>
<physician>John Hoskin</physician>
<diagnosisCode>FEC9</diagnosisCode>
<diagnosisCode>FXC9</diagnosisCode>
..
</terminal>
<aged key= xxxx ... >
...
</aged>
<sickness key= xxxx ... >
...
</sickness>
</hospital>
approx 5 ( )x 20,000 = 100K records.
Key and patient are the only mandatory fields. The rest of the elements are Optional or multiple elements.
-- XML File End
Here is where I need help
Once I have the DOM how do I go forward in letting the client know what was found in the XML file?
Do I create a MAP to hold the element node links and then forward say 50 links at a time to the JSP and then wait to send some more links when the user hits next page?
Is there an automated way of displaying the links, either via a Java Script, Jquery, XSLT or do I just create a table in HTML and place patient links inside the rows? Is there some rendering specific thing I have to do in order to display the data depending on the browser used by client?
Any guidance, tutorials, examples or books I can refer to would be greatly appreciated.
Thank you.
I don't know an automatic way to match the type in jQuery, but you can test the attributes, something like verify if a non optional attribute in the object is present:
// Non optional Infant attribute
if(obj.nonOptionalAttribute) {
// handle Infant object
}
Or you may add an attribute to differentiate the types (something like a String or int attribute to test in your Javascript).
if(obj.type == 'infant') {
// handle Infant object
}
#John.west,
You can try to bind the XML to a list of objects (something like Injure implements MyXmlNodeMapping, Terminal implements MyXmlNodeMapping, Infant implements MyXmlNodeMapping and go on and have a List) to iterate and search by the value at the back end or you can pass this XML file to a Javascript (if you are using jQuery you can use a get or a post defining the result type as XML) and iterate over the objects to find what the user is trying to find...
Your choice may be based on the preference to use processor time in the server side or in the client side...
I want to get the id, title, summary, start-date, end-date, is-current and company name for each position that a LinkedIn member has entered on its profile.
I tested a query on the REST Console and I got the desired result. The query is "https://api.linkedin.com/v1/people/~/positions:(id,title,summary,start-date,end-date,is-current,company)?format=json".
The problem is that when I try to do the same thing using the LinkedIn javascript SDK I'm not getting the whole list of fields for each position. I'm getting the complete list of positions, but not all the fields for each position.
This is the call that I'm doing with the javascript SDK:
//in this function I'm specifying the list of fields that I want to retrieve for each position
//but I'm getting only some fields (id, start-date and end-date)
function getProfileData() {
IN.API.Raw("/people/~/positions:(id,title,summary,start-date,end-date,is-current,company)?format=json").result(onSuccess).error(onError);
}
Somebody has any idea of what I need to do to get the same result than using the REST Console?
Requesting URL is wrong.
Use following for positions
https://api.linkedin.com/v1/people/~:(id,positions)?format=json
Use following for locations
https://api.linkedin.com/v1/people/~:(id,location)?format=json
If you want to retrieve your profile data use this,
IN.API.Profile("me")
.fields([
"firstName","lastName","headline","positions:(company,title,summary,startDate,endDate,isCurrent)","industry",
"location:(name,country:(code))","pictureUrl","publicProfileUrl","emailAddress",
"educations","dateOfBirth"])
.result(onSuccess)
.error(onError);
(or) If you want to retrieve other profile data then replace "me" with "<public profile url>"
IN.API.Profile("url=https://nl.linkedin.com/in/williamhgates")
.fields([
"firstName","lastName","headline","positions:(company,title,summary,startDate,endDate,isCurrent)","industry",
"location:(name,country:(code))","pictureUrl","publicProfileUrl","emailAddress",
"educations","dateOfBirth"])
.result(onSuccess)
.error(onError);
This is public spreadsheet created using Google Drive:
https://docs.google.com/spreadsheets/d/1hA4LKZn9yKoqnSzaI6_73GQSj_ZVpB3O0kC93QM98Vs/pubhtml
How to retrieve data from Google Spreadsheet to Javascript or JSON with new Google Spreadsheets API version 3.0 ?
You can access a cell-based basic feed using the following URL structure: https://spreadsheets.google.com/feeds/cells/1hA4LKZn9yKoqnSzaI6_73GQSj_ZVpB3O0kC93QM98Vs/od6/public/basic?alt=json . By default the feed is in XML form, however, you can request JSON format using alt=json query parameter.
This feed also supports JSONP requests, so an example of fetching this data from a browser with jQuery might look like:
var url = "https://spreadsheets.google.com/feeds/cells/1hA4LKZn9yKoqnSzaI6_73GQSj_ZVpB3O0kC93QM98Vs/od6/public/basic?alt=json";
$.ajax({
url:url,
dataType:"jsonp",
success:function(data) {
// data.feed.entry is an array of objects that represent each cell
},
});
If, alternatively, you want to keep it all in the Google environment. if you're looking for a more controlled JSON generator, check out this gist:
JSONPuller
It takes in a Spreadsheet sheet and returns an array of objects, with the row that you decide as the key (defaults to whichever row is frozen)
Cheers,
I made it work using opensheet.
Steps:
Make sure the sheet as read access - Anyone with the link can view it.
Sheet should have First row as Header row with titles
Then get the sheet data as json using the following link - https://opensheet.elk.sh/spreadsheet_id/sheet_name
Replace spreadsheet_id with your sheet id and sheet_name with your sheet name. No authentication is required.