How to immediately redirect to an entry after creating the new entry from a frontend form? I'm using a frontend form to create an entry with {{ actionInput('entries/save-entry') }} and would like to be able to use this entry immediately upon redirecting from the submit. From the docs I see that the redirectInput() function only accepts a url string. Is it possible to get my hands on the newly created entry's id in order to use it in the redirect?
For context, I have a page with a user-operated form which, when submitted, creates an entry that represents the customer's order. And upon submission I want to immediately head to a review page where it displays the new order's details back to them. Is there a better way to go about this flow? The only thing I can think to do is use a hidden field to set a unique hash on the slug which I also use in the url put in the redirect.
I think the answer is as simple as providing the new Entry's URI to the redirectInput function:
&lt;form method=&quot;POST&quot;&gt;
  {{ actionInput('entries/save-entry') }}
  {{ redirectInput('{uri}') }}

  &lt;input type=&quot;text&quot; name=&quot;title&quot;&gt;
  &lt;button&gt;Save!&lt;/button&gt;
&lt;/form&gt;

Craft looks at the string you pass in, and evaluates it as an &quot;object template,&quot; wherein you can use the short-hand syntax here ({uri}) to access properties of the saved Entry.

Keep in mind! The behavior here differs based on what Controller you're using—sometimes it'll be a different kind of Element, which may or may not have a useful/predictable uri (i.e. if you're updating an Asset).

The &quot;template&quot; you pass in can be as complex as you want. For example, if the form was part of your dashboard, you might want to prepend with a path of some kind:
{{ redirectInput('my-account/orders/{id}') }}

Similarly, you can use regular Twig syntax here—Craft just does some of these easy substitutions for you:
{{ redirectInput('my-account/orders/{{ object.id }}') }}


Note that the &quot;template&quot; won't get rendered in the actual request, so you'll see exactly what you typed here (well, plus a hash of the string, so users can't manipulate it)—it's only evaluated when submitted.

For more info, check out the redirectToPostedUrl($object) method!