Hello,

Thank you for everybody's responsiveness to date. This has been a great resource for me so far and I'm very thankful.

This inquiry is based on this post : https://www.outsystems.com/forums/discussion/36927/how-to-upload-an-image-with-outsystems-beginner/. One of the participants had the same issue I am having but I am using a reactive module vs. traditional.

What I'm trying to do:

I would like to be able to upload photos and display them based on employee name.

What I've done so far:

1) I've created two entities based on the instructions found in the post above. 

a) Person - Entity that houses general data

b) PersonPhoto - Entity that houses photo (type binary) with identifier data type "Person Identifier".


2) I created a screen "Add Staff"with a form widget to input a new person and added a save button with "on click" action with CreateorUpdatePerson. 

Screen Widget / Properties / Action Flow



QUESTION:  This set up currently works however I am uncertain as to how the "PersonID" input variable gets fed into the save button and later into the action flow to create a person. I took the Traditional web developer training however it's done differently on Reactive. I'm thinking this may be the problem down the road.

3) I later added an upload widget in the same screen to upload a photo and link it to the UserID for the person that was added. For the properties of the "upload" widget, I created a variable to represent what I later want to "assign" in the action flow as "PersonPhoto.Photo" data. This variable is a local variable and it's "BinaryDataVar." 

QUESTION:  My intuition tells me this should be an input variable. I tried this but receive an error on data type.

Screen Widget/Properties

Action / Interface


When I run the module on the browser here is the error I receive: 

I'm not entirely sure how to interpret this but based on the responses I've read, it sounds like the PersonID is not being communicated properly. 

Lastly - I created placeholder screen and OutSystems filled it in with Employee data from what I'm assuming is an OS sample dataset. This screen shows employee lists and calls pictures based on ID and it does exactly what I'm trying to do. I noticed the Photo is included in the same entity, but it also sounds like we want to separate these so to improve perfomance. 

Any help is much appreciated and apologies for the wall of text!



Hi Edwin,

Did you debug with breakpoint on the CreateOrUpdatePersonPhoto action?
Show the value of PersonId in this moment, please.

Hi Edwin,

For the mentioned use case, I will define the form submit button action as mentioned below:


Hope this helps you!


Regards,

Benjith Sam

Daryna Kravets wrote:

Hi Edwin,

Did you debug with breakpoint on the CreateOrUpdatePersonPhoto action?
Show the value of PersonId in this moment, please.

Hi Daryna, 

Here is the variable when I click save after inputting the "New Employee" Details.


Solution

Hi Edwin,


PFA - includes the .oml solution file


Hope this helps you!


Regards,

Benjith Sam

Solution

Daryna Kravets wrote:

Hi Edwin,

Did you debug with breakpoint on the CreateOrUpdatePersonPhoto action?
Show the value of PersonId in this moment, please.

Thank you Daryna. I had not use the debut too much but your answer brought awareness to me. I will be using this more often going forward before posting. Appreciate your time.