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)



Screenshot of the Google Sheet



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;
}









share|improve this question
























  • 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















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)



Screenshot of the Google Sheet



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;
}









share|improve this question
























  • 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













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)



Screenshot of the Google Sheet



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;
}









share|improve this question















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)



Screenshot of the Google Sheet



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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


















  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()