Skip to main content
10-Marble
October 20, 2021
Solved

cannot add rows to InfoTable session variable

  • October 20, 2021
  • 2 replies
  • 2794 views

I have an infotable session variable called  testsessvar,  it is defined with a datashape (containing 2 text fields:  Doc_Name,  Doc_URL)

 

on the server side I have a service defined as follows

{

input  newinfotable_entry     (using same dateshape as the one the session variable uses)

tmp = Resources["CurrentSessionInfo"].GetGlobalSessionValues().getRow(0).testsessvar;

tmp.AddRow(newinfotable_entry);

result = tmp;

}

 

the output of this service is connected with the session variable in the mashup (so the update of the session variable is being done on the client side,  I have also tried to update it in the script with same result)

The idea is to be able to continually add rows to the infotable session variable

 

unfortunately the only thing being added is empty objects (the below image shows what gets returned from

the above service)

 

KK_9150368_0-1634743269038.png

 

This second image shows the input value of newinfotable_entry

 

KK_9150368_1-1634743694399.png

 

Best answer by TravisPickett

Hi @KK_9150368,

 

I have attached some example entities that shows adding rows to a session variable.  I am not exactly sure why your example is not working but in mine I passed in the info table session variable to my service to add rows.

 

If you are updating session variables via the session tab in a mashup ( client side ) it is best to pass this variable into your target service instead of using: "Resources["CurrentSessionInfo"].GetGlobalSessionValues().getRow(0).testsessvar".  The resources gets session variables server side.

 

Thanks,

 

Travis

2 replies

10-Marble
October 20, 2021

BTW,  the 2 versions of TWX if have tried this on are:   9.2.0-b30  and 9.1.0-b10877

14-Alexandrite
October 22, 2021

I am not a professional, but when adding values, I assign the row-values individually.

 

Like this:

tmp.AddRow({

      Doc_Name: newinfotable_entry.Doc_Name,

      Doc_URL: newinfotable_entry.Doc_URL

)};

 

I hope this helps

Best regards

10-Marble
October 22, 2021

I actually tried that also to no avail

Support
November 2, 2021

Hi @KK_9150368.

 

It sounds like your question was answered to your satisfaction.  If so, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon