15
Views
8
Comments
A method to display an anonymous user's recent input details submission (summary)

Hi OS community!

I'm generally new to the OS Platform, and I wanted to ask for help. 

Is there a method to display an anonymous user's recent input details submission (summary) before submission? Let's say the context of this is a new user account application for an outsystems app. I guess it is something similar to a Google Form that shows the submitted details post-submission, regardless if the user is anonymous or not.

Best,

Rafa 

Rank: #333

Hi Rafael,

Yep this is definitely possible. You can create a Submission Entity which stores the data you require without linking it to a User ID. A User ID can be linked to a submission after the user is created if required.

If you wanted to link the User ID at a later time one way of doing this is having an optional User ID column in your Submission Entity which is left blank when the anonymous user populates and saves the form. A User ID can be assigned to that record at a later time when his/her OutSystems account is eventually created.

Ossama 

Rank: #3151

Ossama Ghanem wrote:

Hi Rafael,

Yep this is definitely possible. You can create a Submission Entity which stores the data you require without linking it to a User ID. A User ID can be linked to a submission after the user is created if required.

If you wanted to link the User ID at a later time one way of doing this is having an optional User ID column in your Submission Entity which is left blank when the anonymous user populates and saves the form. A User ID can be assigned to that record at a later time when his/her OutSystems account is eventually created.

Ossama 

 Hi Ossama,

Thank you for the reply! I think I get the gist of what you're saying. Let me share what I have done so far. :)

I've made a simple form that contains about 8 input field widgets, and 1 submission/next button. The button contains an if widget and a server action to save/create the details submitted. I created a new page that supposedly proceeds right after the previously mentioned one, and this is where I will transfer the submit button. This contains an aggregate that displays the data. Only issue is that it shows all the submitted data, and not just the current anonymous user. I changed the filter of the aggregate into a "local variable (with data type EntityId) = Entity.Id. Now if I place a number as test value in the aggregate display, it will show the data based on the order of submission. But once I publish the app and attempt to repeat the steps, the data table/aggregate is blank. 

May I ask for your opinions?

Best,

Rafa   

 

Rank: #333

Hi Rafa

Great start! 

What you need to do is ensure that you are saving the submission data in the first page and then pass through the Entity ID of that form submission as a page input parameter of the next page. Then use that input parameter to filter for that particular submission record in the aggregate you mentioned. 

Note that test values in aggregates are only used for testing purposes during development and do not presist when you publish your module. 

Ossama

Rank: #3151

Ossama Ghanem wrote:

Hi Rafa

Great start! 

What you need to do is ensure that you are saving the submission data in the first page and then pass through the Entity ID of that form submission as a page input parameter of the next page. Then use that input parameter to filter for that particular submission record in the aggregate you mentioned. 

Note that test values in aggregates are only used for testing purposes during development and do not presist when you publish your module. 

Ossama

 Would it be alright to ask for a visual example? I attempted to do it, but I'm not sure if what I did was correct nor accurate. 

 

Rank: #333

Hi Rafa

Your save/next page action should look something like this (I'm using the Users Entity as an example):

Your second page must have an input parameter of your submission ID:

In the second page in the aggregate of the submissions being returned, filter for the ID passed in as the input parameter: 


Ossama

Rank: #3151

Ossama Ghanem wrote:

Hi Rafa

Your save/next page action should look something like this (I'm using the Users Entity as an example):

Your second page must have an input parameter of your submission ID:

In the second page in the aggregate of the submissions being returned, filter for the ID passed in as the input parameter: 


Ossama

 What does the Run Action Server action contain? 

 

Rank: #333

The SaveSubmissionData action represents the CreateOrUpdate action of your Submission Enitity e.g.

Ossama

Rank: #3151

Ossama Ghanem wrote:

The SaveSubmissionData action represents the CreateOrUpdate action of your Submission Enitity e.g.

Ossama

 Thanks, Ossama! I went back to this feature after a few weeks, and I was able to pull it off with help. I used a similar approach, and applied the logic you shared — I think it's called something like using a Session Id. Thanks again!