Last inert ID returning but not working in form success

I have an action file that based on a condition will either insert, update or delete a record. The form that uses this action populates using a data detail.

What I’m trying to do is reload the data detail after successful insert action (form success event) based on the last insert id. I need to reload it because there is a section in the form that will show after the record is inserted (created). If I hard code the next insert ID value (because I know what it will be) it reloads successfully to the correct record I just created, but if I try to get last insert ID dynamically using the returned “identity” it doesn’t work.

I can see in the console that it’s returning the identity though.
Screen Shot 2021-01-23 at 11.58.04 AM

I’m sure I’m missing something simple but I’ve been at it about an hour now and can’t figure it out.

Thanks in advance,
Twitch

What I tend to do is run a flow on the form success (not submit button) that has a Run action which loads my data detail. That then “refreshes” the data as it were.

<form id="demo" method="post" is="dmx-serverconnect-form" action="dmxConnect/api/demo.php" 
dmx-on:success="run([{run:{action:`mydatadetail.load({},true)`}}])">

If you need to reload the server action which shows the records from your database, you can just load it on success dynamic event of the form insert.

Thanks for the reply as always guys. That’s exactly what I’m doing. I have a flow on form success. It just doesn’t seem to be using the returned insert id (identity)