Skip to main content
Oct 20, 2021 3:35 PM UTC
Solved

cannot add rows to InfoTable session variable

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

 

Oct 28, 2021 12:31 PM UTC

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

6 replies

Oct 20, 2021 7:12 PM UTC

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

Oct 22, 2021 8:40 AM UTC

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

Oct 22, 2021 6:09 PM UTC

I actually tried that also to no avail

Nov 2, 2021 6:44 PM UTC

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