Search code examples
google-apps-scriptgoogle-app-maker

I want to set the image to match with Email


I create a table to show a picture of my friend and me but I can't get my friend picture in data_source and show my picture only.

First, I get picture form Datasource of google (Gmail profile picture) and I use filters like this

var empsDS = app.datasources.CurrentUser;
var email = widget.parent.datasource.item.Email;
empsDS.query.filters.PrimaryEmail._equals= email;
empsDS.load(); 

but program show my picture only

P.S. This is code to get a picture

@datasources.CurrentUser.item.ThumbnailPhotoUrl !== null ? @datasources.CurrentUser.item.ThumbnailPhotoUrl : window.DEFAULT_PROFILE_IMAGE_URL

Image Ex. enter image description here


Solution

  • The reason it shows only your picture is because your datasource points to only the current user. you need to get the directory and find matches to the emails in order to get the each picture.