Displaying Labels instead of Internal Values (Google Apps Script/Google Sheets/HubSpot)
up vote
0
down vote
favorite
You could say I'm a real newbie to coding. Right now I'm trying to connect the HubSpot Account to Google Data Studio via Google Apps Script and Google Sheets. I'm starting with simple stuff like in this example:
https://medium.com/@alexisbedoret/create-a-hubspot-custom-dashboard-with-google-spreadsheet-and-data-studio-27f9c08ade8d
I tried to build my code like the one in the example above. The problem is, that I'm getting the internal values of the "Deal Stage" and the "Pipeline" (the status if you will) the deals are in instead of the respective labels or names that are "attached" to the internal values (see photo)
Other stuff, like the Deal Name (or "Bewerbermanagementsystem" in the picture) is working properly.
Don't know if this is enough information for you guys, but it would be great if someone could help me, because I really do lack of knowledge in coding :D
Here's the section of the code:
function getDeals() {
var service = getService();
var headers = {headers: {'Authorization': 'Bearer '+ service.getAccessToken()}};
var keep_going = true;
var offset = 0;
var deals = Array();
while(keep_going) {
var url = API_URL + "/deals/v1/deal/paged?properties=dealstage&properties=pipeline&properties=bewerbermanagementsystem&properties=amount&properties=dealname&properties=dealtype&limit=250&offset="+offset;
var response = UrlFetchApp.fetch(url, headers);
var result = JSON.parse(response.getContentText());
keep_going = result.hasMore;
offset = result.offset;
result.deals.forEach(function(deal) {
var dealstage = (deal.properties.hasOwnProperty("dealstage")) ? deal.properties.dealstage.value : 0;
var pipeline = (deal.properties.hasOwnProperty("pipeline")) ? deal.properties.pipeline.value : 0;
var bewerbermanagementsystem = (deal.properties.hasOwnProperty("bewerbermanagementsystem")) ? deal.properties.bewerbermanagementsystem.value : "unknown";
var amount = (deal.properties.hasOwnProperty("amount")) ? deal.properties.amount.value : 0;
var dealname = (deal.properties.hasOwnProperty("dealname")) ? deal.properties.dealname.value : 0;
var dealtype = (deal.properties.hasOwnProperty("dealtype")) ? deal.properties.dealtype.value : 0;
deals.push([stageId,pipeline,bewerbermanagementsystem,amount,dealname,dealtype]);
});
}
return deals;
}
javascript api google-apps-script google-sheets hubspot
add a comment |
up vote
0
down vote
favorite
You could say I'm a real newbie to coding. Right now I'm trying to connect the HubSpot Account to Google Data Studio via Google Apps Script and Google Sheets. I'm starting with simple stuff like in this example:
https://medium.com/@alexisbedoret/create-a-hubspot-custom-dashboard-with-google-spreadsheet-and-data-studio-27f9c08ade8d
I tried to build my code like the one in the example above. The problem is, that I'm getting the internal values of the "Deal Stage" and the "Pipeline" (the status if you will) the deals are in instead of the respective labels or names that are "attached" to the internal values (see photo)
Other stuff, like the Deal Name (or "Bewerbermanagementsystem" in the picture) is working properly.
Don't know if this is enough information for you guys, but it would be great if someone could help me, because I really do lack of knowledge in coding :D
Here's the section of the code:
function getDeals() {
var service = getService();
var headers = {headers: {'Authorization': 'Bearer '+ service.getAccessToken()}};
var keep_going = true;
var offset = 0;
var deals = Array();
while(keep_going) {
var url = API_URL + "/deals/v1/deal/paged?properties=dealstage&properties=pipeline&properties=bewerbermanagementsystem&properties=amount&properties=dealname&properties=dealtype&limit=250&offset="+offset;
var response = UrlFetchApp.fetch(url, headers);
var result = JSON.parse(response.getContentText());
keep_going = result.hasMore;
offset = result.offset;
result.deals.forEach(function(deal) {
var dealstage = (deal.properties.hasOwnProperty("dealstage")) ? deal.properties.dealstage.value : 0;
var pipeline = (deal.properties.hasOwnProperty("pipeline")) ? deal.properties.pipeline.value : 0;
var bewerbermanagementsystem = (deal.properties.hasOwnProperty("bewerbermanagementsystem")) ? deal.properties.bewerbermanagementsystem.value : "unknown";
var amount = (deal.properties.hasOwnProperty("amount")) ? deal.properties.amount.value : 0;
var dealname = (deal.properties.hasOwnProperty("dealname")) ? deal.properties.dealname.value : 0;
var dealtype = (deal.properties.hasOwnProperty("dealtype")) ? deal.properties.dealtype.value : 0;
deals.push([stageId,pipeline,bewerbermanagementsystem,amount,dealname,dealtype]);
});
}
return deals;
}
javascript api google-apps-script google-sheets hubspot
Try running your code in debugger. You'll get a lot of feedback from it.
– Cooper
Nov 7 at 18:54
@Lars How are you going with your Google scripts problem? Worked it out, or still needing help?
– Tedinoz
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
You could say I'm a real newbie to coding. Right now I'm trying to connect the HubSpot Account to Google Data Studio via Google Apps Script and Google Sheets. I'm starting with simple stuff like in this example:
https://medium.com/@alexisbedoret/create-a-hubspot-custom-dashboard-with-google-spreadsheet-and-data-studio-27f9c08ade8d
I tried to build my code like the one in the example above. The problem is, that I'm getting the internal values of the "Deal Stage" and the "Pipeline" (the status if you will) the deals are in instead of the respective labels or names that are "attached" to the internal values (see photo)
Other stuff, like the Deal Name (or "Bewerbermanagementsystem" in the picture) is working properly.
Don't know if this is enough information for you guys, but it would be great if someone could help me, because I really do lack of knowledge in coding :D
Here's the section of the code:
function getDeals() {
var service = getService();
var headers = {headers: {'Authorization': 'Bearer '+ service.getAccessToken()}};
var keep_going = true;
var offset = 0;
var deals = Array();
while(keep_going) {
var url = API_URL + "/deals/v1/deal/paged?properties=dealstage&properties=pipeline&properties=bewerbermanagementsystem&properties=amount&properties=dealname&properties=dealtype&limit=250&offset="+offset;
var response = UrlFetchApp.fetch(url, headers);
var result = JSON.parse(response.getContentText());
keep_going = result.hasMore;
offset = result.offset;
result.deals.forEach(function(deal) {
var dealstage = (deal.properties.hasOwnProperty("dealstage")) ? deal.properties.dealstage.value : 0;
var pipeline = (deal.properties.hasOwnProperty("pipeline")) ? deal.properties.pipeline.value : 0;
var bewerbermanagementsystem = (deal.properties.hasOwnProperty("bewerbermanagementsystem")) ? deal.properties.bewerbermanagementsystem.value : "unknown";
var amount = (deal.properties.hasOwnProperty("amount")) ? deal.properties.amount.value : 0;
var dealname = (deal.properties.hasOwnProperty("dealname")) ? deal.properties.dealname.value : 0;
var dealtype = (deal.properties.hasOwnProperty("dealtype")) ? deal.properties.dealtype.value : 0;
deals.push([stageId,pipeline,bewerbermanagementsystem,amount,dealname,dealtype]);
});
}
return deals;
}
javascript api google-apps-script google-sheets hubspot
You could say I'm a real newbie to coding. Right now I'm trying to connect the HubSpot Account to Google Data Studio via Google Apps Script and Google Sheets. I'm starting with simple stuff like in this example:
https://medium.com/@alexisbedoret/create-a-hubspot-custom-dashboard-with-google-spreadsheet-and-data-studio-27f9c08ade8d
I tried to build my code like the one in the example above. The problem is, that I'm getting the internal values of the "Deal Stage" and the "Pipeline" (the status if you will) the deals are in instead of the respective labels or names that are "attached" to the internal values (see photo)
Other stuff, like the Deal Name (or "Bewerbermanagementsystem" in the picture) is working properly.
Don't know if this is enough information for you guys, but it would be great if someone could help me, because I really do lack of knowledge in coding :D
Here's the section of the code:
function getDeals() {
var service = getService();
var headers = {headers: {'Authorization': 'Bearer '+ service.getAccessToken()}};
var keep_going = true;
var offset = 0;
var deals = Array();
while(keep_going) {
var url = API_URL + "/deals/v1/deal/paged?properties=dealstage&properties=pipeline&properties=bewerbermanagementsystem&properties=amount&properties=dealname&properties=dealtype&limit=250&offset="+offset;
var response = UrlFetchApp.fetch(url, headers);
var result = JSON.parse(response.getContentText());
keep_going = result.hasMore;
offset = result.offset;
result.deals.forEach(function(deal) {
var dealstage = (deal.properties.hasOwnProperty("dealstage")) ? deal.properties.dealstage.value : 0;
var pipeline = (deal.properties.hasOwnProperty("pipeline")) ? deal.properties.pipeline.value : 0;
var bewerbermanagementsystem = (deal.properties.hasOwnProperty("bewerbermanagementsystem")) ? deal.properties.bewerbermanagementsystem.value : "unknown";
var amount = (deal.properties.hasOwnProperty("amount")) ? deal.properties.amount.value : 0;
var dealname = (deal.properties.hasOwnProperty("dealname")) ? deal.properties.dealname.value : 0;
var dealtype = (deal.properties.hasOwnProperty("dealtype")) ? deal.properties.dealtype.value : 0;
deals.push([stageId,pipeline,bewerbermanagementsystem,amount,dealname,dealtype]);
});
}
return deals;
}
javascript api google-apps-script google-sheets hubspot
javascript api google-apps-script google-sheets hubspot
edited Nov 7 at 19:17
Dave
2,00151322
2,00151322
asked Nov 7 at 17:43
Lars
1
1
Try running your code in debugger. You'll get a lot of feedback from it.
– Cooper
Nov 7 at 18:54
@Lars How are you going with your Google scripts problem? Worked it out, or still needing help?
– Tedinoz
yesterday
add a comment |
Try running your code in debugger. You'll get a lot of feedback from it.
– Cooper
Nov 7 at 18:54
@Lars How are you going with your Google scripts problem? Worked it out, or still needing help?
– Tedinoz
yesterday
Try running your code in debugger. You'll get a lot of feedback from it.
– Cooper
Nov 7 at 18:54
Try running your code in debugger. You'll get a lot of feedback from it.
– Cooper
Nov 7 at 18:54
@Lars How are you going with your Google scripts problem? Worked it out, or still needing help?
– Tedinoz
yesterday
@Lars How are you going with your Google scripts problem? Worked it out, or still needing help?
– Tedinoz
yesterday
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194922%2fdisplaying-labels-instead-of-internal-values-google-apps-script-google-sheets-h%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try running your code in debugger. You'll get a lot of feedback from it.
– Cooper
Nov 7 at 18:54
@Lars How are you going with your Google scripts problem? Worked it out, or still needing help?
– Tedinoz
yesterday