No announcement yet.

Issue with image field

  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue with image field

    Hi, I need to show different images depending on the value of a field. I created a workflow to check the value of a field and replace the image value using the instruction:

    imageId = '62d92ea2194668b23';

    The images are correctly uploaded to the "upload" folder but when the control field condition changes and therefore the "imageId" value changes, one of the images (the one that is replaced) is physically deleted from the upload folder.


    ifThenElse (
    field == 'A',
    imageId = 'id of pic1.png',
    imageId = 'id of pic2.png'

    Case 1:
    field = A
    imageId = 'id of pic1.png'

    the images are both in the upload folder.

    Case 2:
    field != A
    imageId changes from 'id of pic1.png' to 'id of pic2.png'

    the 'pic1.png' image is deleted from the upload folder.

    My Espo version is 7.1.3, Advanced Pack is 2.9.3.

    I hope I well explained myself and that you can help me solving this problem.

    Thank you

  • #2
    This post should not be in the bug reports section. Please don't post such posts in bug reports.
    Last edited by yuri; 08-01-2022, 12:16 PM.


    • #3
      You need to duplicate an attachment record, set sourceId = id of the original attachment record. Set the field and the relatedType corresponding to the parent record.