Skip to main content
Sep 3, 2018 4:53 AM UTC
Solved

How to compare two infotable fields

Hello all,

 

Can anyone tell me, how to compare two infotable fields are same ?

 

Thanks,

VR

Sep 3, 2018 10:03 AM UTC

Ok, then you need to recover Infotable definition fields, to do that you can use the following code:

 var fields ;//
 if ((infotable.dataShape==null)||(infotable.dataShape==undefined)) {
 fields = infotable.ToJSON().dataShape.fieldDefinitions;
 } else {
 fields = infotable.dataShape.fields;
 }

Than you do for both infotables, and check if they have the same fields.

 

 

4 replies

Sep 3, 2018 8:37 AM UTC

What does you mean with two infotable fields? All the rows for the same field name or what?

VelkumarAuthor
Sep 3, 2018 9:48 AM UTC

Hello @CarlesColl,

 

I want to compare whether both Infotable have same field's. We are not comparing rows.

 

Regards,

VR

Sep 3, 2018 10:03 AM UTC

Ok, then you need to recover Infotable definition fields, to do that you can use the following code:

 var fields ;//
 if ((infotable.dataShape==null)||(infotable.dataShape==undefined)) {
 fields = infotable.ToJSON().dataShape.fieldDefinitions;
 } else {
 fields = infotable.dataShape.fields;
 }

Than you do for both infotables, and check if they have the same fields.