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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

How to add json data to an infotable

Willie
16-Pearl

How to add json data to an infotable

I'm currently using the following lines to create an infotable from json:

 

 

	var json = {
		rows: jsonData.run_history, //an array of objects
		dataShape: DataShapes["SomeDataShape"].GetDataShapeMetadataAsJSON()
	};
    
	///////////////////
	//Loads json data to an infotable
	var data = Resources["InfoTableFunctions"].FromJSON({
		json: json
	});

 

 

I'd like to add more data from jsons to the infotable, but the FromJSON service replaces the previous data.  Is there a service that adds JSON data to the infotable?  Kind of like .AddRow?  I'd like to avoid using a for loop to add each row one-by-one as there are many rows.  Also, is there a limit to the size (MBs) of the infotable?

ACCEPTED SOLUTION

Accepted Solutions
Velkumar
19-Tanzanite
(To:Willie)

Hi @Willie 

 

If you want to merge two infotable with same datashape, use the Union function

 

let params = {
    t1: infotable1/* INFOTABLE */,
    t2: infotable2/* INFOTABLE */
};

 

// result: INFOTABLE
let result = Resources["InfoTableFunctions"].Union(params);

 

For different datashape please refer to his article - Article - CS237109 - How to Merge InfoTables in ThingWorx (ptc.com)

 

I don't think InfoTable has any size limitation based on my experience.

 

/VR

View solution in original post

5 REPLIES 5
Velkumar
19-Tanzanite
(To:Willie)

Hi @Willie 

 

If you want to merge two infotable with same datashape, use the Union function

 

let params = {
    t1: infotable1/* INFOTABLE */,
    t2: infotable2/* INFOTABLE */
};

 

// result: INFOTABLE
let result = Resources["InfoTableFunctions"].Union(params);

 

For different datashape please refer to his article - Article - CS237109 - How to Merge InfoTables in ThingWorx (ptc.com)

 

I don't think InfoTable has any size limitation based on my experience.

 

/VR

Hi @Velkumar 

 

I forgot about that one.  Thank you.

 

Regarding the size of the infotable, I should have said the amount of memory used in a service.  In AWS Lambda, it can error if the the amount of memory used in the lambda function exceeds the amount of memory set for the lambda function.

Velkumar
19-Tanzanite
(To:Willie)

Hi @Willie 

 

I really don't have any idea about InfoTable Sizing for Lambda function. 

 

Please create PTC support ticket for this requirement

 

/VR

nmutter
16-Pearl
(To:Willie)

I don't know of a limit for a service. The platform itself has x amount of memory available, depending on the host system and its configuration. If one service would consume all memory the platform will be unstable. The amount of RAM available for the applications is configured by the Apache Tomcat servers configuration.

Refer to step in the installation instructions: "17. Set the Initial memory pool and Maximum memory pool fields to 75% of the available OS memory (for example, 12GB for a 16GB RAM system). Refer to JVM Tuning for additional information. here "

 

You can see the current memory usage (of ThingWorx) in "Monitoring -> SystemStatistics" to somewhat get a feeling:

nmutter_0-1691751763827.png

 

Willie
16-Pearl
(To:nmutter)

Hi @nmutter 

 

I checked system stats on both dev and prod instances, which are hosted by PTC Cloud, but "memory in use" and "total memory allocated" were blank.

Announcements


Top Tags