Retrieve the image file associated to the Asset in Mindsphere

1
Experts,        I have uploaded an image file to Mindsphere and associated the same to an asset. My requirement is as follows:        When I retrieve the list of assets and display the same in a Mendix app, upon selecting the specific asset row, I need to pull it’s associated image file from Mindsphere and display it in an iFrame. If anyone had done this before, appreciate if the details can be shared.   Thanks, Kalyan
asked
4 answers
1

You will have probably created an Image entity in Mendix which is associated with the Asset entity in Mendix. Now when you display Asset objects in a list view or data grid, you can create a data view that listens to the list or grid widget (assets list). On selection of any row, data view is passed that row (asset) object. Now inside this data view, you have the selected asset, you can make Mindsphere call to fetch its image, store it in Mendix and display it. 

If you are looking for HTML and JS solution. Use click event for selection and then fetch image, update your Iframe HTML element via  JS with new image. 

answered
0

Thank you Umar for the detailed explanation. Appreciate it.

answered
0

Hello Umar, 

        This is how I was trying as you suggested.

       1. First thing, in Mindsphere I uploaded an image file to the specific asset

       2. Created a dataview that listens to the selected asset row.

  1. Inside this dataview I am trying to call a microflow wherein I want to use the Mindsphere REST API (iotfileservice API) to get the file content. I defined something like this (NOTE: The microflow is not fully complete):

 

 

  1.  This API returns back the image file as its response. I need some help here in defining the import mapping and how to store this returned image into the entity that is defined with the System.Image as its generalization
  2. In my case I defined an entity called “AssetImg” with System.image set as its generalization. I associated this entity to my “AssetDetails” entity

 

Any help on the above will be appreciated.

 

Thanks,

Kalyan

answered
0

Please ignore. I was able to figure out the above.

Thanks again for your guidance.

answered