How to update "field" element of the Table Object "column" property?

I think you're mixing up scripts and expressions. Start there, and if needed we'll provide more details.

Have you gone through the free Inductive University online training? It's a slog, but covers all of the basics you need. Otherwise, the online User Manual and SDK documentation (linked from the user manual) are remarkably thorough. Pure python syntax is left for you to study via other resources. (As is the use of java objects in jython.)

I have the exam in hand for the Core Certification, so I hope that answers that question. The detail of the coding I have had questions with is not contained well within that training. Is there an offline version of the documentation?

I guess the API and SDK documentation will help but as I'm in the middle of a project, the reading will have to wait until this is finished, which is the reason for my urgency in closing these details above.

The syntax for the Expression Language is entirely documented within the Ignition user manual, as this is entirely defined by Inductive Automation.

On top of the basic syntax and operators, expressions may use many functions, which are documented in an appendix, and can be supplemented by functions from third party modules. Like mine, as an example.

Python and Jython are not documented, except briefly and in examples, in Ignition's User manual, as these are open source components with large and thorough public documentation.

BTW:

This doesn't answer any question for me, as I explain here:

I've heard too many quiet complaints from clients about "certified" individuals (and not just core) not knowing what they were doing.

But you can't get to the core cert without first going through IU, so I guess he did do it.

Yes, I did do all the IA training, which is what is required to attempt the certification, which is for some reason a requirement of some customers.

I do not believe that any product providers offer any training, which would allow one to create the dream application. This can only come with time and effort (and support), within the specific development environment.

I have used just about all other visualization tools on the market throughout my career and I find that this is an excellent tool with amazing potential, but with a relatively steep learning curve as compared to the others.

I have stated a few times in this thread that I am new to this product and "not knowing what I'm doing" is not incorrect as it applies to this product (certified or not), nor would I claim otherwise; with or without certification. The certification is for me a limited benchmark, which highlights for me what more I need to learn.

My questions posed in the forum are intended to gather support for an immediate need and to get information on where to look, without having to come back and ask.

I have come to this forum with questions to help improve my competence and would never (nor have I ever) called myself an "expert" in anything, as there is always someone better, but certainly not to be criticized in any fashion.

I hope that this forum does not become like many online forums, where criticism in lieu of support is the norm.

I appreciate everyone's "help", as it relates to the questions posed.

The solution to my question is this:


def transform(self, value, quality, timestamp):
import java.lang
import java.util

	render_map = {
		java.lang.String: "string",
		java.lang.Integer: "number",
		java.util.Date: "real"
	}
			
	return [
		{
			'field': col_name,
			'sortable': True,
			'render': 'date' if col_name.lower() == 'time' else render_map.get(col_type, "auto"),
			'dateFormat': "MM/DD/YYYY HH:mm:ss",
			'header': {
				'title': col_name.replace('_', ' ').title()
			}
		} for col_name, col_type in zip(value.columnNames, value.columnTypes)
	]

The original line:

 'render': render_map.get(col_type, "auto")  

was modifed to:

'render': 'date' if col_name.lower() == 'time' else render_map.get(col_type, "auto")

which is the solution to my question.

Thank you chatGPT for knowing Python

I'll suggest another solution.
Find the type of your 'time' column and add it to the map.
Why ? 2 reasons:

  1. If for some reason you get a column named "date", or "timestamp". or anything that's not "time", a string comparison will fail.
  2. If you need to add more of those conditions, what do you do ? You'll need to chain conditions, and that gets ugly real quick.

Including "Time", "TIME" , or other variants

Ignore me, I can't read. Time to leave early.

He did use .lower() so case is not a problem.

1 Like