Two way link with a urlParam to a temp var

Having trouble figuring out the right way to do this.

I sometimes pass an invoice_id into the order entry page. This sets a temp var which is used by the app to load up that invoice. Works fine.

image

I would also like to have the URL reflect an invoice_id created/opened from within the app. I have tried variations of this:

image

But what happens is currentInvoice.value and the URL briefly change to show everything correctly and then both clear.