Passing an object from one page to another

Hi All,
In legacy app, I can bind selected value of a table to an app variable and retrieve the individual value using selectedValue. for specific value.
How can I do the same in VB apps? I’ve tried to bind the .selectedItem to an app variable (of object). but not sure how to retrieve it. there must be a better way to have to bind individual value to app variable as text.

Thanks.

You can access variables across pages, if you want to bind or populate another page control, try on page load event

Hello @LeoRX ,

check below video,

Thanks guys for taking the time to respond. the source of my table is not from data service. so entity type variable does not work.

The source of my table is a data table from output argument of process. so within the same page, I’d just get the value as follows;

MainPage.Table.SelectedItem.CustomerName

Since cross page reference does not work, I currently have it stored as object.

MainPage.Table.SelectedItem => TableSelect

as Object App variable.

The problem is that you can’t simply do TableSelect.CustomerName to retrieve the customer name value.

Only way I can think of is serialise it to text and use regular expression to retrive the value as follows;

System.Text.RegularExpressions.Regex.Match(Serialize(TableSelect),“”“CustomerName”“:”“(.*?)”“”,RegexOptions.Multiline).Groups(1).Value

Is there a better way to do this?

Thanks.

Found another way to do this and is slightly better than using regular expression.

  1. Create an AppVariable with datatable as type
  2. Set value → AppVariable as MainPage.Table.SelectedItem.Table
  3. Set Value → AppVariable as AppVariable.AddRow(MainPage.Table.SelectedItem)

Finally, the individual column value can be retrieved as
AppVariable.Rows(0)(“CustomerName”).ToString

It will be great to be able to have a datarow as variable type and just write .