Load Contact Photo

  

Hello guys,

I'm using the contacts plugin in order to get a contact detail from my contact list, but i cant get the photo of the user.

I am getting the list of photos and using to display an image as a external URL, but it only shows me the default image.

I am printing the variable of the external URL and it show somthing like this: 

Can you help with this?


Thanks guys :)

Hi Nelson, 

I had worked on similar functionality, Where I had to show the image of a particular user. I simply used Image widget, selected type as Binary Data and provided the binary data as image content. 

It's worked for me. Please refer the attached screen shot.

Cheers!!

Sachin

Nelson Mendes wrote:

Hello guys,

I'm using the contacts plugin in order to get a contact detail from my contact list, but i cant get the photo of the user.

I am getting the list of photos and using to display an image as a external URL, but it only shows me the default image.

I am printing the variable of the external URL and it show somthing like this: 

Can you help with this?


Thanks guys :)

Hi Nelson.

To use the image widget with External URL, you would need to have the URL to the image. 

So, in your use case, you should use the type = Binary Data, since you have the data on your side.

Cheers,

GM

Gonçalo Martins wrote:

Nelson Mendes wrote:

Hello guys,

I'm using the contacts plugin in order to get a contact detail from my contact list, but i cant get the photo of the user.

I am getting the list of photos and using to display an image as a external URL, but it only shows me the default image.

I am printing the variable of the external URL and it show somthing like this: 

Can you help with this?


Thanks guys :)

Hi Nelson.

To use the image widget with External URL, you would need to have the URL to the image. 

So, in your use case, you should use the type = Binary Data, since you have the data on your side.

Cheers,

GM


Hello Gonçalo,

I am trying to do that, but the contact widget for photos gives me a value with the type text. How can i get the Binary data?

Image on attachment.

Thanks for the reply Guys,

NM


Hi Nelson.

That text you mentioned isn't the picture in Base-64?

If so, you can convert Base-64 to Binary and it should work.

Cheers,

GM

Gonçalo Martins wrote:

Hi Nelson.

That text you mentioned isn't the picture in Base-64?

If so, you can convert Base-64 to Binary and it should work.

Cheers,

GM

I am printing the "type" as well the "Value", it always show me the type as URL and a value of a folder in my device.

But when i use that URL the img widget it shows me the default URL.


Cheers,

NM


Hi Nelson,

Adding to what Gonçalo and Sachin wrote, you can do the binary conversion by using the BinaryData extension, and its Base64ToBinary public action.

Jorge Martins wrote:

Hi Nelson,

Adding to what Gonçalo and Sachin wrote, you can do the binary conversion by using the BinaryData extension, and its Base64ToBinary public action.


I am aware of those functions, but as i said in the previous response, it gives me a URL not a binary data :(

Thanks,

NM

Nelson,

Have you tried to print the URL of each image and open them on the browser?


Gonçalo Martins wrote:

Nelson,

Have you tried to print the URL of each image and open them on the browser?


I have tried yes.

It shows me a server error (404), but my contact has a photo. Maybe the plugin is not fetching the photo?

Thanks,

NM


So that's the problem..A 404 is a page not found error, so if you can't reach the image, you can't display it.

Try to debug your plugin and check why you're getting an invalid url.

Gonçalo Martins wrote:

So that's the problem..A 404 is a page not found error, so if you can't reach the image, you can't display it.

Try to debug your plugin and check why you're getting an invalid url.


Hi Gonçalo,


I'm using this plugin: https://www.outsystems.com/forge/component/1394/contacts-plugin/

It wasn't supposed to have that error right? Since it is a outsystems plugin.

Cheers,

NM