Skip to main content
13-Aquamarine
June 3, 2024
Solved

Printing multiple rows from single infotable column

  • June 3, 2024
  • 2 replies
  • 2294 views

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

Best answer by TravisPickett

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

2 replies

19-Tanzanite
June 3, 2024

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

13-Aquamarine
June 3, 2024

Hello,

 

Thanks for the help but I need result in infotable 

12-Amethyst
June 3, 2024

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

Community Moderator
June 11, 2024

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.