Skip to main content
1-Visitor
February 22, 2017
Question

how to rename the field of infotable in thingworx

  • February 22, 2017
  • 1 reply
  • 6573 views

how to rename the field of infotable(result of queryDatatableEntries)?

1 reply

5-Regular Member
February 22, 2017

Hi Meenakshi Agrawal,

You can create a new service which uses queryDatatableEntries then you can use RenameField snippet to rename the field.

Rename Snippet:

var params = {

  t: undefined /* INFOTABLE */,

  from: undefined /* STRING */,

  to: undefined /* STRING */

};

// result: INFOTABLE

var result = Resources["InfoTableFunctions"].RenameField(params);

I hope it helps.

magrawal1-VisitorAuthor
1-Visitor
February 22, 2017

Thanks Ankit Gupta​,

I need to rename multiple fields, multiple time calling rename snippet will slow down the service..ryt?

What would be the best way to rename multiple fields?

5-Regular Member
February 22, 2017

There is no snippet available for renaming multiple infotable column in one go.

Can you please share your requirement that why is the renaming of infotable column required?

For e.g. If you are using the output in some Mashup Grid. You can rename the column name in the widget itself instead of changing it in the infotable.