Hello,

I am trying to add product images to our product screen.  I have one image per product ID, and need each image to match the correct record (name, location etc.). 

I am having difficulty setting up the action to sync these entities together.  At the moment, all product images are in a file on my laptop desktop.  

We have reviewed all documentation and searched the forum for an answer - Can anybody point me in the right direction to solve this? Or describe the actions we need to take.

Thank you,

Reemah

So, for future reference, you may want to include the type of application you're working on (web, mobile) and the platform and Service Studio versions you're using, as this information can be helpful when people are trying to help you.

Before you can display the file, you will need to upload it. Docs can be found here:

https://success.outsystems.com/Documentation/11/Developing_an_Application/Design_UI/Inputs/Enable_End-Users_to_Upload_Files

G. Andrew Duthie wrote:

So, for future reference, you may want to include the type of application you're working on (web, mobile) and the platform and Service Studio versions you're using, as this information can be helpful when people are trying to help you.

Before you can display the file, you will need to upload it. Docs can be found here:

https://success.outsystems.com/Documentation/11/Developing_an_Application/Design_UI/Inputs/Enable_End-Users_to_Upload_Files

Hi Andrew, 

Thanks for your help, this is a mobile app.  I have followed the instructions on the documentation, although I'm unsure if I have done this section correctly: 



Does this look correct to you? 

How will setting up the upload widget retrieve product images from our desktop file? I'm conscious that we haven't set up a bootstrap action, like we have with the other data.  


Many thanks,

Reemah 

"Does this look correct to you?"

From the image, it looks like you're using the GetProductTrainerPicture entity action. If you're trying to save an uploaded picture, you will need the CreateOrUpdateProductTrainerPicture entity action.

"How will setting up the upload widget retrieve product images from our desktop file? I'm conscious that we haven't set up a bootstrap action, like we have with the other data."

This thread may be helpful, in terms of a more detailed explanation of how you can bootstrap images for an application (last post, particularly):

https://www.outsystems.com/forums/discussion/34463/bootstrap-images/

G. Andrew Duthie wrote:

"Does this look correct to you?"

From the image, it looks like you're using the GetProductTrainerPicture entity action. If you're trying to save an uploaded picture, you will need the CreateOrUpdateProductTrainerPicture entity action.

"How will setting up the upload widget retrieve product images from our desktop file? I'm conscious that we haven't set up a bootstrap action, like we have with the other data."

This thread may be helpful, in terms of a more detailed explanation of how you can bootstrap images for an application (last post, particularly):

https://www.outsystems.com/forums/discussion/34463/bootstrap-images/

Hi, thanks again. 

I have edited the entity action to CreateOrUpdateProductTrainerPicture, I think this is correct now. 



Re the thread with information on bootstrapping images, I downloaded the FilePlugin and the GetFileData is available when selecting the dependency to add it, but not once the dependency is added.




I also tried using FileSystem component but this is for web application only.  The link https://www.outsystems.com/forums/discussion/12775/how-to-bootstrap-users-with-roles-and-groups/ seems to be for adding users rather than products (unless I'm confused!)


Our product screen looks like this currently: 



If you could give some further guidance that would be much appreciated.

Thank you,

Reemah 

Hi Reemah,

Client (and Server) Actions will be available in the Logic tab of Service Studio, not on the Data tab that you were looking at.

The post Andrew pointed you to, although it does link to How to bootstrap Users with Roles and Groups (meant as a detailed example of bootstrapping logic), also mentions the Employee Services Forge component and provides a high-level description of how it implements bootstrapping employee pictures from a Zip file. Of course you will always need to adapt these examples (check the code for the SampleData_BootstrapEmployeePictures action in Employee Services) to your own requirements.

Jorge Martins wrote:

Hi Reemah,

Client (and Server) Actions will be available in the Logic tab of Service Studio, not on the Data tab that you were looking at.

The post Andrew pointed you to, although it does link to How to bootstrap Users with Roles and Groups (meant as a detailed example of bootstrapping logic), also mentions the Employee Services Forge component and provides a high-level description of how it implements bootstrapping employee pictures from a Zip file. Of course you will always need to adapt these examples (check the code for the SampleData_BootstrapEmployeePictures action in Employee Services) to your own requirements.

Hi Jorge, 

Thanks for your explanation, I am new to app development and it is taking me some time to understand the software and community instructions.

I have used Employee Services as a point of reference and created the same logic within my own app (of course adapted).. and this seems to be working.



Now that the logic is set up, do I need to input the picture data into the excel spreadsheet that is linked to the ProductTrainerPicture data entity? At the moment this is empty and the pictures are still in a desktop file. Or do I need to use the FilePlugin? The options in FilePlugin are faded.



Thank you in advance for help,

Reemah 

"I have edited the entity action to CreateOrUpdateProductTrainerPicture, I think this is correct now."

I think you misunderstood my meaning. On the ProductTrainerPicture entity, there should be a set of entity actions, which includes CreateOrUpdateProductTrainerPicture. What I was saying is you need to use that entity action in the screen action responsible for uploading the picture, in order to save the binary data to the entity. Only then can you use the picture for display.

Hope that helps.

G. Andrew Duthie wrote:

"I have edited the entity action to CreateOrUpdateProductTrainerPicture, I think this is correct now."

I think you misunderstood my meaning. On the ProductTrainerPicture entity, there should be a set of entity actions, which includes CreateOrUpdateProductTrainerPicture. What I was saying is you need to use that entity action in the screen action responsible for uploading the picture, in order to save the binary data to the entity. Only then can you use the picture for display.

Hope that helps.

Hi,

Ahh sorry, is this where you mean? This is the upload widget on my products page. 


I see the entity action you mentioned:

This is the action set on CreateOrUpdateProductTrainerPicture:


I don't want to confuse matters more than they already are, but you keep saying that the images you want to upload are on a desktop computer, but it looks to me like you are developing a mobile app ???

Dorine Boudry wrote:

I don't want to confuse matters more than they already are, but you keep saying that the images you want to upload are on a desktop computer, but it looks to me like you are developing a mobile app ???

Hi Dorine, 

You're right, I am developing a mobile app.  I'm using service studio on my laptop to build the app, which is where the photo's are, but there's no reason these can't be on my phone too... Am I missing something?