Skip to main content
13-Aquamarine
Jun 3, 2024 11:45 AM UTC
Solved

Printing multiple rows from single infotable column

Hello All,

I have a service which takes a input in string (it is basically a parent equipment name) in the output I am getting an infotable I want to print all assets under that parent. I am to do that but only first equipment is getting printed.

 

PFA and also check data type I might be missing something 

 

Thanks

12-Amethyst
Jun 3, 2024 1:41 PM UTC

Hi @Pratik_Aswale 

 

Based on Screenshot 27 you have what you are asking for, just with additional information.  Depending on what you mean by "print" you can display this in a grid and hide/exclude the extra columns.  Put this in a dropdown and use ThingName as display.

 

If you want the resulting infotable to only include ThingName then you will have to transform the info table into another table by creating a new info table ( I would recommend using OOTB DataShape, EntityList).  Look at the code snipits for info table on how to create, loop, and add entries.

 

Thanks,

 

Travis

5 replies

19-Tanzanite
Jun 3, 2024 12:17 PM UTC

Hi @Pratik_Aswale 

 

If you want ThingName as a String 

 

let thingNameArray = [];
result1.rows.toArray().forEach( row => {
 thingNameArray.push(row.ThingName);
});

// Convert array to string
let result = thingNameArray.join(",") // Seperate each thingname by comma

 

/VR

Translate
13-Aquamarine
Jun 3, 2024 12:28 PM UTC

Hello,

 

Thanks for the help but I need result in infotable 

Translate
12-Amethyst
Jun 3, 2024 1:41 PM UTC

Hi @Pratik_Aswale 

 

Based on Screenshot 27 you have what you are asking for, just with additional information.  Depending on what you mean by "print" you can display this in a grid and hide/exclude the extra columns.  Put this in a dropdown and use ThingName as display.

 

If you want the resulting infotable to only include ThingName then you will have to transform the info table into another table by creating a new info table ( I would recommend using OOTB DataShape, EntityList).  Look at the code snipits for info table on how to create, loop, and add entries.

 

Thanks,

 

Travis

Translate
Community Moderator
Jun 11, 2024 3:08 AM UTC

Hello @Pratik_Aswale, 

 

It looks like you have some responses from some community members. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Community Moderation Team.

Translate