Oracle Apex Set values before moving to another page, Items are all null
<p><strong>I am trying to do the following:</strong></p>

<ul>
<li>Anonymous user with a unique key enters a code and clicks 'Start Survey'</li>
<li>The button needs to call a plsql process to populate some hidden page items.</li>
<li>Once the values are set branch to the survey page which will use the hidden items for filtering results.</li>
</ul>

<p><strong>The Problem</strong></p>

<p>No matter what I have tried so far the items set by the process are null when I get to the next page. I assume this is because it did not submit. The way I have it at the moment is:</p>

<ul>
<li>Button navigates to the next page</li>
<li>New process set to when the button is pressed sets the values of the page items.</li>
</ul>

<p>By the time it gets to the next page they are blank again.</p>

<p>I could set the button to submit and do the branch in the processing but I think the submit would happen before the values are set. I find it confusing what order these things happen in.</p>

<p>Can I please get help with making this work, and is there a good article on understanding this area better?</p>

<p>here is the code from the process that puts the values in:</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>Begin

select id into :P1_pat_id 
from lic_paticipent
where unique_id = :P1_unique_code;

select sur_id into :P1_sur_id 
from lic_paticipent
where unique_id = :P1_unique_code;

select id into :P1_first_res_id
  from lic_result r
  where r.pat_id = :P1_pat_id
  and   r.sur_id = :P1_sur_id
  and   r.qop_id is null
  and   rownum = 1;

End;</code></pre>
</div>
</div>
</p>

<p>Thanks in advance for your help.</p>