Can't decide on ONE way to pass a just posted value to another API query

There must be at least 5 different ways to pass along a particular posted variable from one form page to the next page.

I don’t want the variable visible in the URL.

In fact, I’d like to incorporate that posted id variable as soon as the form is submitted to the database to be used directly inside the next custom query API that retrieves the just saved database record.

So that instead of referring to the last Key ID (as in autoincremented id) I want that unique field variable to limit the database query to fetch the newly saved database record.

And I see options to refer to a json string to get and apply that value to the page record retrieval API.

Although I’m on a php project I don’t want to use my tried & true PHP solutions.

So – from

form submit page

—> on to

form retrieve data page

{{$_POST.story_ID}} (generated as a text string from a time value using year-month-day down to hours-minutes-seconds)
I want to pass into the actual API sql query so that the query launches with the story_id just posted as the WHERE condition.

I added another step to my insert form query to grab the POSTED story_id and save that value as a named variable that I can refer to in my Get Record API.

So, instead of setting up another action in my page 2 “Retrieve just saved Record” page using another file include to just pull the $_POST.story_id I could retrieve this page with that value already used as the WHERE parameter.

But I’m sure I haven’t set this up correctly . . .

I have gone to my Retrieve Data API (see_new_record)
and pulled in the form page fields to use as variables – so far.

Can’t you use just one API call for posting and fetching at the same time? Personally, inside such API call, I would use Library exec steps to Insert and Fetch, and the API call would call those Library actions

On form submit:

  • Exec Library/Insert
  • Exec Library/Fetch

Or if you want to skip the Library actions, just put both database queries sequentially, so the 2nd query directly grabs the variable outputted by 1st query

On a side note, your post is hard to read to those not familiar with your project. You post screenshots of the back-end, but it’s hard to follow the narrative without supporting screenshots of the front-end. So, I tried my best to answer your question given my limited experience with Wappler’s front-end :slight_smile:

Edit: If a page change is required, I suggest putting the ID in a session variable (but again, I’m not sure if I’m entirely understanding your situation)

Thank you, @Apple !

As I have used session variables before that value has been related to a value that within the given session will NOT change – as in the personal id of the logged-in User. So, in that sense it is not a “variable” once the session is initiated. The “employee_id”, for instance, will no longer qualify as a “variable” in the most technical sense. It becomes a fixed value all during that session.

What I am using is essentially a Global query to generate a constantly changing unique “story_id” that is called for at the time the form displays for all users in their sessions. Concatted with their user id it is unique and different from second to second.

Exactly why I posted.

I want to pass into the actual API sql query so that the query launches with the story_id just posted as the WHERE condition.

That is what I was trying to show with my screenshots and tried to explain – that instead of writing a whole new query to add to my page that in the API that does the Insert, I would add a 2nd action to that insert API that grabbed the Posted story id value and gave it a separate name that I could reference by itself in the

I added another step to my insert form query to grab the POSTED story_id and save that value as a named variable that I can refer to in my Get Record API.

I haven’t used the Library Actions yet.

I’m looking at this now:

Thanks again! As soon as I grasp this I will be using these.
In PHP, of course, I frequently used the equivalent on the server side.
Only in PHP they are called FUNCTIONS or CLASSES.

It looks like a lot of clicking but this is apparently going to achieve the access to posted values I want as a filter for my “Review your Saved data” page.

Thanks again, @Apple !