Edit, Replace or Remove the Uploaded Pic

Edit, Replace or Remove the Uploaded Pic

  
HI, HOw to Edit Replace or remove the uploaded pic using another upload widget.

I have attached an oml file. Actually I'm trying to replace the image in Employee Details page which as uploaded first durring Employee creation page.

Please take a look at this and guide me.
Hi Sathish,

I've looked to your code and it seems to me that you are not updating the image because of the aggregate that you have in the Save action.

In the aggregate GetEmployeePicture2s2 you're not filtering the current Employee. If you add the filter Employee.Id = EmployeeId your code will work.

Hope this solution helps you.

Cheers.
António Marques


I did add the filter in save function. But still it doesn't updating when I update the pic in Employee details page.
Hi Sathish,

The image isn't updating because in the Save action you have an If and with their condition/connectors direction, you only be able to update the image when the uploaded filename it's the same of the Form.

Probably you'll have to review this logic.

Cheers.


António Marques wrote:
Hi Sathish,

The image isn't updating because in the Save action you have an If and with their condition/connectors direction, you only be able to update the image when the uploaded filename it's the same of the Form.

Probably you'll have to review this logic.

Cheers.

So How can I change it to accept any file name rather than the file name from the form?
Can you explain in details?. Sorry, I'm a novice in outsystems. Please bear me. 

Cheers
 
 
Solution
Hi,

If that is your use case you have to options: 
1. Change the condition (instead of equal (=), you have to put not equal (<>);
2. You just have to swap the If connectors (to do it you only have to right-click in the If widget and then choose the Swap Connectors option)
Don't forget that in both cases you also have to add a condition to validates if the user uploaded a new image or not,  otherwise it will update without any new picture (For option 1: "... and Upload1.Filename <> "";  For option 2: "... or Upload1.Filename = "" ).

Cheers.
Solution
António Marques wrote:


Hi,

If that is your use case you have to options: 
1. Change the condition (instead of equal (=), you have to put not equal (<>);
2. You just have to swap the If connectors (to do it you only have to right-click in the If widget and then choose the Swap Connectors option)
Don't forget that in both cases you also have to add a condition to validates if the user uploaded a new image or not,  otherwise it will update without any new picture (For option 1: "... and Upload1.Filename <> "";  For option 2: "... or Upload1.Filename = "" ).

Cheers.
 You are Great...!! Thanks :)