Displaying images from attachments at runtime
As a developer or an application business analyst, you can configure a view definition to display images from attachments. The images are displayed in the application.
Use the Image component to display an image stored in an attachment field. For example, you can display an avatar stored in an attachment field.
Before you begin
Make sure that you have created an attachment field in the record definition.
To learn more about adding attachment fields, see Creating-or-modifying-regular-record-definitions.
To add an image view component to a view definition
- Log in to BMC Helix Innovation Studio and navigate to the Workspace tab.
- Select the application to which you want to add the Image component.
- On the Views tab, click the name of the view definition to which you want to add the Image component.
- From Palette, drag the Image component to the canvas.
In the Properties pane, click the
Settings icon, and complete the fields as described in the following table:
Field
Action
Name
Enter a name to uniquely identify the Image component.
Record definition name
Select the record definition that contains the attachment field in which the image is stored.
Field name
Select the attachment field of the record definition in which the image is stored.
Record ID
Click Edit to build an expression that points to the record instance ID.
Horizontal alignment
Select the appropriate alignment for the image.
Maximum width
Specify the maximum width for the image in pixels or percentage.
The default value for this property is the original width of the image.
Important: If these fields are blank, the image is displayed by using its original dimensions.
Hidden
Select if you want to hide this field.
- Click Save.
To verify the view definition, click Preview.
Result
After configuring the Image view component, the following conditions describe how the image is rendered:
- Attached image is valid—Image is displayed correctly.
- Attached image is invalid—Image is not displayed. An icon indicating broken image is displayed.
- Attachment is absent—Image is not displayed.