Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi All,
I currently know how to link the dropdown menu to the label. Now have other problems.
1) How can I store the image local path in the postgresql database?
1) How to link the dropdown menu to the image stored in localhost? Both info are from postgresql database.
2) How to link the dropdown menu to a grid, elements in which are other corresponding columns but not including the selected dropdown value.
Thanks!
Solved! Go to Solution.
First Map the selectedRows-> name to a Label and check its the Building Name Then Map that to the service getDataTableEnrties and pass that name parameter to getDataTableEnrties service which i think will give you all data and from that map the OutsidePic to Image widget
Tiantian, is Postgresql used as persistence provider or are you connecting to it via the extension as external DB?
I think for your above scenario you can begin by may be creating a table in the DB which will store the path and the file name (file ID) however way you want to refer each entry and then from the platform you'll need a DatabaseThing with SQL service Inserting values. Now as to getting the path you can use the FileSystemServices to get path information for any file which you can pass to your SQL script for storing that in DB
To Store image in any database you will need to create a data table on that basis take a datashape which has one field as Imagelink and add assign a media entity to it so then you will be able to see that image in your datatable as well as then you will be able to call it using the key in the same row.
I want to store the image path in PostgreSQL database like this, my column name is, OutsidePic
Then I select the building name, at the same time, want to OutsidePic to change accordingly, like this:
But failed.
This getBuilding service is to the DropDown Or its the service which takes output from dropdown?
This getBuilding service is to the DropDown. And the selected Row is binded to the output from dropdown, like the picture path to the SourceURL.
But on the selected Name you want the address to come right? if so then you have to bind the selectedRows-> name to the next service which will have logic to get output. as you are saying getBuilding is service whose all data mapped to Dropdown widget then first you have to get selected Building from same dropdown.
First Map the selectedRows-> name to a Label and check its the Building Name Then Map that to the service getDataTableEnrties and pass that name parameter to getDataTableEnrties service which i think will give you all data and from that map the OutsidePic to Image widget
Yes. I should attach the name to the dropdown menu first.
But I just attach the return data to the dropdown menu, then select DisplayField as the Name. This way seems wrong..
another question, if the dropdown selection as input, an grid (another infotable) and other information as output, how can I manage to do this?
Means:
Input: dropdown selection (building name)
Output: Building year, building manager name, and a list(grid) of building lift condition
yes you can manage this . as there must be a Datatable for all this in which there are this fields like Name,Address, Building Year, Manager, etc so here name should be primary key on hat basis you can write a query in the service that search data table entries on the basis of name. thats it.
Hi Pravin,
How to seach data table entries use a output of a dropdown? That is the question. This is a new service under the Thing and this service is written by SQL or javascript? Can you please describe it in more details? Thank you! pravin pradhan
Hi Tiantian, if you are storing the data in the DataTable you'll need a JS script if the data you are storing is going to a table in the Database in that case you'll need a SQL script. Just wanted to clarify this since it seems that terminology Datatable and the Table in the database is used interchangeably in this discussion. These are two different things even though they may appear the same.
I store the data in postgreSQL database.
My question is, how can I manage to use the selection of Dropdown Menu as input to do the SQL selection in the database?
Is this a dynamic menu or a static menu? In either case you'll have to get the selected menu to be stored in a temporary runtime type variable, may be you can set the session variable with that. And once you have the session variable you can pass that as the input parameter to your SQL Script.
Hi Sushant,
It is a static menu. Still no idea how to get the session variable... Sorry