Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

110
Visualizações
Materialize Autocomplete with Dynamic Images

I'm using the following code for my Google Sheet Apps Script which autocompletes an input field with my Google Contacts. It works with the text, but I can't make it fetch profile images as well. This the code I'm using, and as far as I understand the null value is where the img should go, but I'm unable to pass it without ruining the whole thing. Could you please help me?

// Autocomplete for phone numbers
function getAvailableTags1() {
  const contacts = People.People.Connections.list("people/me", {
    personFields: "names,photos,phoneNumbers,nicknames",
    pageSize: 1500
  }).connections;
  const res = contacts.reduce((ar, c) => {
    if (c.hasOwnProperty("names") && c.hasOwnProperty("photos") && c.hasOwnProperty("nicknames") && c.hasOwnProperty("phoneNumbers")) {
      const name = c.names[0].displayNameLastFirst;
      const img = c.photos[0];
      const number = c.phoneNumbers[0].value;
      const nick = c.nicknames[0].value + " (" + number + ")"; 
      
      ar.push([
        name+`
`+number+` 

`+nick]);
    }
    return ar;
  }, 
  []);
var dynamicOptions = {};
       res.forEach(function(v) {
          dynamicOptions[[v]] = null
       });
       Logger.log(dynamicOptions);
       return dynamicOptions;
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda