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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

How to show uploaded files on mashups as per ThingWorx user?

DT
13-Aquamarine
13-Aquamarine

How to show uploaded files on mashups as per ThingWorx user?

 Hi Everyone,
I have query here please check below statement:

  1. I have a multiple user like supplier in supplierGroup.
  2. Also I have one repository i.e  XYZ_repo  in ThingWorx
  3. When any supplier will add any files from mashup to XYZ_repo repository I want to show this files on the grid widgets having parameter(name,lastModifiedDate,size,link) .
  4. If multiple supplier user will add files into the repo at the same time I want to show files data as per user on grid widget.

ex: user1 uploaded 2 attachment and user2  uploaded 3 attachment that means.

user will see only 2 attachment and user 2 will see only 3 attachment on the grid

     5.I am using Thingworx 8.1 version I know its old but I don't have any option right now.

 

I don't want to show all files in grid I want show files data on grid on user specific. 

Please suggest any solution

 

 

6 REPLIES 6
VladimirRosu
19-Tanzanite
(To:DT)

Does your FileUpload widget have a FileUpload completed event?

 

DT
13-Aquamarine
13-Aquamarine
(To:VladimirRosu)

Hi @VladimirRosu 

Yes FileUpload widget have FileUpload completed click event.

DT
13-Aquamarine
13-Aquamarine
(To:DT)

Hi Everyone,

Can anyone please let me know the above solution in ThingWorx?

CharlesJi
15-Moonstone
(To:DT)

Hi @dt, I guess you can achieve this by maintaining a list (a data table or anything), in which, the information of the uploaded file (e.g., file name and path, etc.) and the session (the current user). 

(The insert operation may be executed after the FileUpload Completed event.)

Then in your displaying widget, you'll need another custom service, it reads the session information to get the current user and gives the corresponding list of files.

nmutter
16-Pearl
(To:DT)

Easy solution would be to bind the upload path, where the file will be uploaded to. Use the User-variable name in this path.

nmutter_0-1652809837544.png

In upload widget bind the name to the upload-path:

nmutter_1-1652809847636.png

 

So you will end up in a folder structure like:

FileRepository/<user1>/file1

FileRepository/<user1>/file2

FileRepository/<user2>/file1

 

To display only the files of the current user you will also use "FileRepository/<user>" as path filter to retrieve the file list.

With this you can create your usecase I think. Depending on your usernames you may need add additional logic to remove invalid charachters for directory names. You may also need to add a "/" before the path - not sure if a / is needed or if <user> is sufficient as path for the widget.

DT
13-Aquamarine
13-Aquamarine
(To:nmutter)

Hi @nmutter 

Thanks for your reply but Is this sure that we can get the repository file name according to user Or is there any servcie where I can get all files as per user name. Because I unable to find any such service from where I can find current user name files from the repository.

Also 

Binding User name it will not working Please suggest the solution how to display and get current user file name list

Announcements


Top Tags