To bring the dataset values under the instances created

How to bring the dataset values under the instances created, ..so that it will get updated automatically as in the dataset, for each element

If I am reading this correctly, I think the lookup expression is what you are looking for.

If I type the serial number in text field, we get the required data set (tester name, pass fail status - columns) with the help of named query..Now, if i want any particular row (tester name and status) to get reflected in the instances which i have created , what should be done?...

It should be like whenever the serial number is typed, as how it's automatically updating the data set , it should update in all the ten instances also..how can the binding be done ?

I binding at the instances property, and create all the json by script.
I copied one instance as a demo, and modify it then put it in a list, return the list at the end.

2 Likes

It should be like whenever the serial number is typed, as how it's automatically updating the data set , it should update in all the ten instances also..how can the binding be done ? as in the above pics

The answer has already been given...

Bind the instances property to the dataset, then add this script transform:

return [
	{
		'testerName': row['TESTERNAME'],
		'status': row['PASSFAILSTATUS']
	} for row in system.dataset.toPyDataSet(value)
]

Or change the repeated view's parameters to match the dataset column names, and you don't even need a transform anymore ! (I think the flex repeater's instances accept datasets)

1 Like

Yes, this worked for each instance when I changed the repeater view's parameter...But how to make the serial number search in one view and it should automatically update the data set in all the instances in another view respective of their TESTERNAME and PASSFAILSTATUS in each instance for that how can the binding be done?
In my project, here I need to type the serial number :point_down:

In another view like this, their respective TESTERNAME and PASSFAILSTATUS should appear..


@pascal.fragnoud

Well, bind the instances property to the thing that changes... and it will be reevaluated each time it changes.

It shows null

You're binding a query that returns a full dataset to a text field that expects a string. We already went over this. You NEED to read the doc and go through the inductive university, this is very basic stuff.

I'll try to make things simple, based on a few assumptions:

  • You have a table that is updated by a query, based on the value of a textfield.
  • You have a flex repeater that you want to update, based on that same textfield
  • solution1: apply the same logic to your repeater's instances property that you applied to your table
  • solution2: bind the repeater's instances property to the table's data property.
1 Like

In ignition, everything is an object, which is a bit strange and unfamiliar to automation engineers. But if you know a modern programming language like python, they're all objects, they're of a type, they have properties, they're instances. Just like charging a mobile phone, which mobile phone and what interface. Once you understand this, it's easy to shape the functionality you want, even very complex ones.

This is what it comes when I apply table logic to the instances property

Show your code. What's the error info? Did you bind to a namequery which need long time?


SELECT TESTERNAME, PASSFAILSTATUS
FROM UT_INTELLIPAK.FPYDPUVIEW
WHERE dbid IN (SELECT DISTINCT dbid
FROM UT_INTELLIPAK.uutinfo
WHERE value = 'C18L08684')

You could notice the error is occured on the Query. Because you didn't bind the Value. You can compare it with your previous screenshot.
After that, the outcome of query, is Dataset, and the instances property, need to bind to a list(or array, whatever).

The value which I binded is this correct from session custom and its key name?
image

Actually, it could be anything,but empty. You do not even use it in your query.
You specify the value target in the query, which is very unnormal. Are you still testing your feature?
Here is a simple demo of my project.


You may have to figure out how your function is implemented first. What are the conditions and outcomes of each step.

Again,

1 Like

Your named query has a parameter that doesn't seem to be used in the query itself? You've set the serial number condition in the where clause to a fixed value; shouldn't this use the parameter?
But as with Pascal, and I've said before, learn ignition via the university first, then come back here with questions once you somewhat understand the fundamentals


Is this correct one ?