[Mobile] How can I pass Local Variable to another screen

[Mobile] How can I pass Local Variable to another screen

  

Hello,

My application is about check-in, using point of interest. Then, after user has checked in, I have stored the location, including details in Local Variable of one screen. After that, I need to use this Local Variable in order to be an input in another screen. 

How can I pass this value to another screen? Please see my screen as follows.


Hi C,


It is not possible to use Records and Lists as input variables to screens. 


So you have two alternatives:

  1. Transform the structure to a more simplified data type (like a Text) so you can pass it directly as an input variable
  2. Save the information in the local storage in a temporary table so you can fetch it on the second screen


Cheers,

Renato


C Tontanasutthivong wrote:

Hello,

My application is about check-in, using point of interest. Then, after user has checked in, I have stored the location, including details in Local Variable of one screen. After that, I need to use this Local Variable in order to be an input in another screen. 

How can I pass this value to another screen? Please see my screen as follows.




Hi C Tontanasutthivong

It looks like that you get a list as output when user checks in and it is true that you cannot send Record or List to other screens as input parameter.

You can very well go for second solution mentioned above.

You can also do one more thing. Take one boolean variable and set its vale as True whenever user checks in. Pass that boolean as input to another screen. If it's value is True, call the same service on second page which you are calling on first page for the output and show results there.

Hope this helps.

Thanks and Regards,

Suraj Borade

Hi Renato Torres and Suraj Borade

Thanks for your recommendation. I've tried adding the local storage and store the value into it. Then, I fetch data from local storage on the second screen, and using GetLocal... as an expression but it shows "0" seems local storage has not stored my value since first screen. If I am missing anyhting, kindly let me know.

1.Adding Local Storage

2.Assign the value in first screen to the Local Storage

3.Fetch Data from Local Storage. Then, tried to get the value. But the result is empty.


Renato Torres wrote:

Hi C,


It is now possible to use Records and Lists as input variables to screens. 


So you have two alternatives:

  1. Transform the structure to a more simplified data type (like a Text) so you can pass it directly as an input variable
  2. Save the information in the local storage in a temporary table so you can fetch it on the second screen


Cheers,

Renato


C Tontanasutthivong wrote:

Hello,

My application is about check-in, using point of interest. Then, after user has checked in, I have stored the location, including details in Local Variable of one screen. After that, I need to use this Local Variable in order to be an input in another screen. 

How can I pass this value to another screen? Please see my screen as follows.






Hi C Tontanasutthivong,

First of all, your step 2. seems strange... You need to assign the values you get in the first screen to a record (if it's a list you may require a For Each too), you seem to be assigning values from one position of the list to another on the same list.

Then you are missing a step between 2. and 3., that's the actual storing of the data in LocalStorage, using (in your case) one of the CreateLocalStoreMasters or CreateOrUpdateLocalStoreMasters entity actions.

On step 3., make sure you get the right record from LocalStorage (if there can be multiple you may need to pass the Id of the newly created temporary record as an input parameter to the second screen).

Finally, after step 3. you need to be sure to cleanup and delete the temporary record(s) you've created, otherwise you may end up using all the available space on the device with temporary data.

I suggest you first go through the online training for mobile application development before you start building your own mobile applications using OutSystems, as it gives you a basic understanding of how to do it and then it'll be simpler for you to understand and/or follow what others may suggest here.


C Tontanasutthivong wrote:

Hi Renato Torres and Suraj Borade

Thanks for your recommendation. I've tried adding the local storage and store the value into it. Then, I fetch data from local storage on the second screen, and using GetLocal... as an expression but it shows "0" seems local storage has not stored my value since first screen. If I am missing anyhting, kindly let me know.

1.Adding Local Storage

2.Assign the value in first screen to the Local Storage

3.Fetch Data from Local Storage. Then, tried to get the value. But the result is empty.

Thanks you guy for recommendation. I have a better undestanding of passing data to another screen, and I've done it already. Cheers.