cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Display Images from repository based on selected items List

Ziyad
9-Granite

Display Images from repository based on selected items List

Hello everybody

 

I'm trying to upload images that figures in my repository in order to visualise them in a mashup,

First I created a simple service for this that return image link based on selected items in a list which are Strings (E1,E2,E3,....) but I figured out that it's not that simple because I can not bind the image doesn't change in my mashup.

Ziyad_0-1598364565270.png

Ziyad_1-1598365077225.png

 

Actually I need to visualise images that exists in my repository but I don't find the file.

 

Ziyad_2-1598365523961.pngZiyad_3-1598365746997.png

Now I don't understand why I don't get the image from my file

ACCEPTED SOLUTION

Accepted Solutions
PaiChung
22-Sapphire I
(To:Ziyad)

GetFileListingWithLinks should get you the link to the image files in your repository

the Image widget should allow you to bind dynamically a link to it.

You could potentially try the value display widget as well, but I believe Image widget is the correct one.

View solution in original post

6 REPLIES 6
PaiChung
22-Sapphire I
(To:Ziyad)

GetFileListingWithLinks should get you the link to the image files in your repository

the Image widget should allow you to bind dynamically a link to it.

You could potentially try the value display widget as well, but I believe Image widget is the correct one.

Ziyad
9-Granite
(To:PaiChung)

Hello PaiChung 

 

Thanks for your answer I actually tried your recommandation but the problem is that I don't find GetFileListingWithLinks service in generic services ? is it a service that exist already in thingworx by default like getdatatableentries for example ? 

 

Also I want to know if I need to specify the path that exist in my disc computer or the path of repository ? 

path : 'TPM.Repositoy/tpm.plb/PALES/PP_355/Images_Elements'

or path : C://ProgrameFiles.... which I don't find by the way

PaiChung
22-Sapphire I
(To:Ziyad)

Service exists on the FileRepository Thing/ThingTemplate

Ziyad
9-Granite
(To:PaiChung)

Thanks for your indication, Actually I created a thing called PLB.images where I put test images that I will use ( (please find attachement below)

 

Now I'm trying to load the image that exists in my repository in order to get a useful link result, so I can do binding after but I'm getting strange error called :

Error executing service GetImageByElement. Message :: ReferenceError: "Thingworx" is not defined. - See Script Error Log for more details.

 

Could you please tell me how could I solve this issue, I'm working on this since few days but it doesn't work, and I also want to understand why.

 

 

PaiChung
22-Sapphire I
(To:Ziyad)

Looks like you are passing in Path incorrectly it should be a string so it needs quotes on each side of it.

 

Ziyad
9-Granite
(To:PaiChung)

Yes Exactly it was a mistake, but although LoadImage service don't work properly so I just used if else conditions to return string each time and it works for me 

 

Thanks for you support 

Announcements


Top Tags