cancel
Showing results for 
Search instead for 
Did you mean: 

Passing multiple rows of data as an XML input to a transaction

Former Member
0 Kudos

Hi,

I have a grid with several rows and columns of data on the front-end UI. I would like to select few rows and pass the data as an XML structure to a transaction. Is this possible? If so, how could I do this?

Regards,

Chanti.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I can suggest following option to get data from multiple row selection from iGrid.

document.AppletName.getGridObject().getSelectedRowCount() to get count of selected Row than you can use for loop on this rowcount than inside loop

document.AppletName.getGridObject().getSelectedRowAt() it will provide you exact Row number of grid which you selected than you can retrive your required data from grid

document.AppletName.getGridObject().getCellValueByName(int row,String sColName)

than you can generate your XML than pass it to transaction.

hope it helps!!

Regards,

Manoj Bilthare

Answers (1)

Answers (1)

sidnooradarsh
Contributor
0 Kudos

Hello Chanti,

Yes, Its definitely possible, I have done it on couple of occasions and it has worked

Option 1:

1) Pass each row value in a string where each row is separated by a comma as shown,

Value1,Value2,Value3.....

2) Then within BLS use it as string input variable and parse it using String_List_To_XML XML action block.

Option 2:

1) If you are aware of the required XML structure then prepare one as string by appending reach rows something like as shown below,


	var SpeedXML = "";
	SpeedXML =	 '<?xml version="1.0" encoding="utf-8"?>'
	SpeedXML =	SpeedXML + '<Rowsets Version="12.1">'
  	SpeedXML =	SpeedXML + '<Rowset>'
	SpeedXML = SpeedXML + '<Columns>'
	SpeedXML =	SpeedXML + '<Column Description="" MaxRange="1" MinRange="0" Name="Average_Run_Speed" SQLDataType="1" SourceColumn="Average_Run_Speed" />'
	SpeedXML =	SpeedXML + '<Column Description="" MaxRange="1" MinRange="0" Name="Line_Stops" SQLDataType="1" SourceColumn="Line_Stops" />'
	SpeedXML =	SpeedXML + '</Columns>'

Here in this section you can loop through your rows and append them to structure,

Start Loop


	SpeedXML = SpeedXML + '<Row>'
	SpeedXML = SpeedXML + '<Average_Run_Speed>'+ Value1 +'</Average_Run_Speed>'
	SpeedXML = SpeedXML + '<Line_Stops>'+ Value2 +'</Line_Stops>'
	SpeedXML = SpeedXML + '</Row>'

End Loop


	SpeedXML = SpeedXML + '</Rowset>'
	SpeedXML =	SpeedXML + '</Rowsets>'

2) Now in the Transaction, use it as String input variable and parse it using String_To_XML XML action block

Hope this helps!!

Regards,

Adarsh