Mobile - Display Binary Data from API

Hello, guys,

I’m a newbie in OutSystems and I'm trying to configure this REST API on a Mobile app but I'm having a hard time

Goal: Get the photo from Microsoft account through Graph REST API and show as an avatar on the app in the Common/UserInfo block. 

What I already did: I created the REST API and the response is in Binary Data. As I learned from this post: I don’t need to convert the binary data to base64 on mobile. So, I created a local variable, data type Binary Data inside a Data Action. I defined the image content to point to this local variable created and data type to binary data.

What I missing: I have no clue how to display the content for this local variable(Binary Data) on the image widget on the screen.

Can someone please shed some light on this? Any advice or tip is welcome.

Thank you in advance.

Luana Almeida

Hi Luana,

- If yes then, did you confirm that you are getting the Binary Data. I mean via debug?

Hello assif_tiger,

- No, I didn´t. 

But I called as you said and now when I logon on the app I received the error "401 Unauthorized" after the authentication. I'm doing the authentication with a token.

- The only way that I have to debug right now it's with log messages because the debug it's not working on Studio(I'm working in a Mac) and I already tried to connect my mobile on computer I'm getting nothing.

Thank you. 

Hi Luana,

Apologies for the answer above, actually DataActions execute automatically, we don't need to call them.

So you can just revert the one which I told to re-call in OnInitialize.

- Just assign the local Variable in the GetUSerPhotoFromAPIOnAfgterFetch&itshouldwork :)