Publication date: 07/15/2025

Replace a JMP Live Report

To replace the contents of an existing report in JMP Live, you need either the path or the ID of the report that you want to replace. To find the report ID in JMP Live, click on a report post. The post ID appears in the URL, or you can copy the ID under Details.

When you replace an existing report, you choose how to update the data. You can use existing data on JMP Live, update the existing data on JMP Live, or publish a new data table.

Example of Replacing a Report Using Existing Data

This example publishes a Graph Builder report and its associated data to a folder in your personal space in JMP Live. Then, the report is replaced with a new Graph Builder report that uses the existing data.

Names Default to Here(1);

// Open the Big Class sample data table.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
/* Run two Graph Builder table scripts and call the reports gbsmoother and gbline. */
gbsmoother = dt << Run Script( "Graph Builder Smoother Line" );
gbline = dt << Run Script( "Graph Builder Line Chart" );
// Create a connection to the JMP Live server.
liveconnection = New JMP Live();

/* Create a folder in your personal space with a title and a description. Use the JMP Live Connection that you established and return a JMP Live Result object called jmpliveresult. */

jmpliveresult = liveconnection << Create Folder( Parent folder( "~" ), Title( "Replace Example - Use Existing" ), If Exists( "use" ) );
// Obtain the JMP Live Folder object from the result.
folder = jmpliveresult << As Scriptable;
// Create a content object containing the gbsmoother report.
content = New JMP Live Content( gbsmoother, Title( "My Smoother Graph" ) );
// Publish the content to the newly created folder.
jmpliveresult = liveconnection << Publish( content, Folder( folder ) );
// Obtain the list of published posts from the JMP Live Result object.
postlist = jmpliveresult << As Scriptable;
// Get the details for the posts.
bcPostId = "";
reportId = "";
For( i = 1, i <= postlist << Get Number Of Items, i += 1,
	type = postlist[i] << Get Type();
	If( type == "Data",
		bcPostId = postlist[i] << Get ID
	);
	If( type == "Report",
		reportId = postlist[i] << Get ID
	);
);
// Create a content object containing the the gbline report.
content = New JMP Live Content( gbline, Title( "My Line Graph" ) );
// Specify in the Replace command to use the existing data.
jmpliveresult = liveconnection << Replace(
	Report( reportID ),
	content,
	Use Existing Data( {{"Big Class", bcPostId}} )
);
// Close all data tables in JMP without saving.
Close All( Data Tables, NoSave );

Example of Replacing a Report and Updating Existing Data

This example publishes a Graph Builder report and its associated data to a folder in your personal space in JMP Live. Then, the report is replaced with a new Graph Builder report that updates the existing data.

Note: All posts in JMP Live that use this data are updated.

Names Default to Here(1);

// Open the Big Class sample data table.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
/* Run two Graph Builder table scripts and call the reports gbsmoother and gbline. */
gbsmoother = dt << Run Script( "Graph Builder Smoother Line" );
gbline = dt << Run Script( "Graph Builder Line Chart" );
// Create a connection to the JMP Live server.
liveconnection = New JMP Live();

/* Create a folder in your personal space with a title and a description. Use the JMP Live Connection that you established and return a JMP Live Result object called jmpliveresult. */

jmpliveresult = liveconnection << Create Folder( Parent Folder( "~" ), Title( "Replace Example - Update Existing" ), If Exists( "use" ) );
// Obtain the JMP Live Folder object from the result.
folder = jmpliveresult << As Scriptable;
// Create a content object containing the gbsmoother report.
content = New JMP Live Content( gbsmoother, Title( "My Smoother Graph" ) );
// Publish the content to the newly created folder.
jmpliveresult = liveconnection << Publish( content, Folder( folder ) );
// Obtain the list of published posts from the JMP Live Result object.
postlist = jmpliveresult << As Scriptable;
// Get the IDs of the report post and data post that you just published.
bcPostId = "";
reportId = "";
For( i = 1, i <= postlist << Get Number Of Items, i += 1,
	type = postlist[i] << Get Type();
	If( type == "Data",
		bcPostId = postlist[i] << Get ID
	);
	If( type == "Report",
		reportId = postlist[i] << Get ID
	);
);
// Create a content object containing the gbline report.
content = New JMP Live Content( gbline, Title( "My Line Graph" ) );
/* Replace the gbsmoother report with the gbline report on JMP Live. Specify to update the existing data. */
jmpliveresult = liveconnection << Replace(
	Report( reportId ),
	content,
	Update Existing Data( {{"Big Class", bcPostId}} )
);
// Close all data tables in JMP without saving.
Close All( Data Tables, NoSave );

Example of Replacing a Report and Publishing New Data

This example publishes a Graph Builder report and associated data to a folder in your personal space in JMP Live. Then, the report is replaced with a new Graph Builder report. A new data table is also published, so the new report uses that data instead of the original data.

Names Default to Here(1);

// Open the Big Class sample data table.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
/* Run two Graph Builder table scripts and call the reports gbsmoother and gbline. */
gbsmoother = dt << Run Script( "Graph Builder Smoother Line" );
gbline = dt << Run Script( "Graph Builder Line Chart" );
// Create a connection to the JMP Live server.
liveconnection = New JMP Live();

/* Create a folder in your personal space with a title and a description. Use the JMP Live Connection that you established and return a JMP Live Result object called jmpliveresult. */

jmpliveresult = liveconnection << Create Folder( Parent Folder( "~" ), Title( "Replace Example - Publish New" ), If Exists( "use" ) );
// Obtain the JMP Live Folder object from the result.
folder = jmpliveresult << As Scriptable;
// Create a content object containing the gbsmoother report.
content = New JMP Live Content( gbsmoother, Title( "My Smoother Graph" ) );
// Publish the content to the newly created folder.
jmpliveresult = liveconnection << Publish( content, Folder( folder) );
// Create a content object containing the gbline report.
content = New JMP Live Content( gbline, Title( "My Line Graph" ) );
/* Replace the gbsmoother report with the gbline report on JMP Live. Specify the report to replace by path, and to publish new data. */
jmpliveresult = liveconnection << Replace(
	Report( "~/Replace Example - Publish New/My Smoother Graph" ),
	Content,
	Publish New Data( {"Big Class"} )
);
// Close all data tables in JMP without saving.
Close All( Data Tables, NoSave );
Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).