Skip to main content
1-Visitor
June 23, 2021
Solved

Create tags to upload dataset to Analytics Builder

  • June 23, 2021
  • 2 replies
  • 981 views

Hi, 

 

I've created a custom service that creates a dataset using the CreateDataSet service from the Analytics Server Data Thing. I want to add tags so that the dataset will appear in the Analytics Builder. I found this snippet of code that will create a tags info table, but I'm confused as to what the if statement will achieve:

 

var tags = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape({
dataShapeName: "GenericStringList" /* DATASHAPENAME */
});
if (displayInBuilder && datasetName){
    tags.AddRow({ item: "builderdataset" });
     tags.AddRow({ item: "builderdatasetname:" + datasetName.toLowerCase()

});

 

When I try to run this code with my datatsetName, it says that "displayInBuilder" does not exist- is this something I need to define, or is this calling another function/service? 

Thanks!

Best answer by nsampat

@RS_9963079 ,

 

The reference tags are flags for the Analytics Extensions to know which datashapes are to be used in the Builder Mashup.

 

It should be noted, that if you load a dataset and perform your analysis in Analytics Server via services, you wont be able to work through builder as a validation job is required (part of the Training/Modelling within Builder Mashup Extensions)

 

Can you provide where you got the snippet from, and what your use case is? Typically users will opt to only use the Analytics Services for job processing and results, or use the provided Builder Mashups in the extensions for the charts and UI, not both simultaneously.

 

Regards,

 

Neel

 

edit: There is another community post with sample custom Services to use ThingWorx Analytics which may be of use - https://community.ptc.com/t5/IoT-Tech-Tips/Analytics-Services-Examples/m-p/724778

 

 

2 replies

nsampat17-PeridotAnswer
17-Peridot
June 23, 2021

@RS_9963079 ,

 

The reference tags are flags for the Analytics Extensions to know which datashapes are to be used in the Builder Mashup.

 

It should be noted, that if you load a dataset and perform your analysis in Analytics Server via services, you wont be able to work through builder as a validation job is required (part of the Training/Modelling within Builder Mashup Extensions)

 

Can you provide where you got the snippet from, and what your use case is? Typically users will opt to only use the Analytics Services for job processing and results, or use the provided Builder Mashups in the extensions for the charts and UI, not both simultaneously.

 

Regards,

 

Neel

 

edit: There is another community post with sample custom Services to use ThingWorx Analytics which may be of use - https://community.ptc.com/t5/IoT-Tech-Tips/Analytics-Services-Examples/m-p/724778

 

 

Community Manager
July 1, 2021

Hi @RS_9963079

 

If you feel your question has been answered, please mark the previous response as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon