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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

How to update datashape dynamically for different services ?

GSPatil
11-Garnet

How to update datashape dynamically for different services ?

Hello Experts,

 

I have 3 SQL queries- services as follows, each of them returns separate infotable containing different number of columns (See attachments). I have configured a list widget to populate the list of these services and I want to execute selected service when selection is changed in list.

 

To achieve this I am trying to write a java script service, but I am facing a issue since each of above services has their specific datashape as per their result. Could anyone helpout me to write this service to dynamically update the datashape of this java script as per the services which are being called by it or selected by list widget

 

Just for info, I am quite new to JS, so expecting your reply accordingly.

 

 

Thanks;

GS

1 ACCEPTED SOLUTION

Accepted Solutions

Hello again,

 

I have modified the attached XML so this should now import into your 8.4 system.

 

Please let me know if you have any further issues.

View solution in original post

6 REPLIES 6

Hello GS,

 

I went ahead and created a small example for you that shows the dynamic capabilities of the Grid Widget. This ios attached to my post.

 

As you will see I created a backing service that handles each possible service selection from the End User. This will dynamically change the format of the Infotable returned which results in the contents of the Grid being changed.

 

Please import the dynamic_grid_entities.xml file prior to importing the Data Table data.

GSPatil
11-Garnet
(To:tmisner)

Hey...!

 

Thanks for quick support, I will tryout this tomorrow morning & will update you. Have a nice day

GSPatil
11-Garnet
(To:tmisner)

Hi , 

Actually I was trying to import the dynamic_grid_entites.xml file, but its not importing. I think its due to version error. I am using version 8.4.5. Can you just confirm the issue for importing and suggest any alternative. Attaching the screenshot of error log for your reference.

Hello again,

 

I have modified the attached XML so this should now import into your 8.4 system.

 

Please let me know if you have any further issues.

GSPatil
11-Garnet
(To:tmisner)

Hi Sir,

Thank you soo much for your kind help.

Your solution worked. Attaching the result for your reference. I have one more question, here in the screenshot the columns names I am getting are customized in SQL query, with '_', since I was unable to put there space ' '. But This is not good way to represent it, how I can update them by putting space, since SQL does't allow the space.

 

Regards;

Ganesh

Hello Ganesh,

 

Happy to have helped and glad the example worked for you!

 

To modify the column headers the best option is to use the Grid Advanced Widget. The basic Grid does not allow for this kind of functionality with dynamic data and "Show All Columns" enabled. Grid Advanced can be acquired from the PTC Marketplace for free. Download it here.

 

I have updated the example provided to use the Grid Advanced Widget. Please be sure that Grid Advanced is imported prior to importing this XML. You will now see the Configuration parameter on the Grid Advanced Widget takes a String input from a backing service (GridConfiguration) which contains a set of parameters as a JSON object. These parameters allow for a host of advanced customizations including, setting the column headers. In my example you can see "FieldA" etc. has been switched to "Field A" etc.

Top Tags