How can I use custom URLs to load full page forms for creating new entities?

You can bookmark or create a URL that opens up a form to create a new Entity (Asset, Shot, Task, etc.). This is handy if you want to bookmark a "New Note" page for quick access.

Developers can also add links to their tools and applications that deep link people into a form that is pre-populated with the correct data. For example, you can build a tool that allows a supervisor who is reviewing Versions to go to a pre-filled Note form. The Note form can have a link to the Version the supervisor was looking at and be addressed to the Artist who created that Version. Or you can embed the new Note form right into your QT application.

How the URL works

The base site URL is appended with "new/" and then the Entity name. The URL for a new Note would look like this:

https://example.shotgunstudio.com/new/Note

The resulting page looks like this:

Use system entity names in URLs

Consult the entities section of the site preferences page for a complete list of these names. Note that these are not the same as the display names. For example, a Person would actually be HumanUser. Below are a few more examples:

New Asset form

https://{your shotgun base url}/new/Asset

New User form

https://{your shotgun base url}/new/HumanUser

New Invoice form (Custom Entity 1)

https://{your shotgun base url}/new/CustomEntity01

Pass values to the form

You can pass more information to the form through the URL. Here are some examples:

Specify a project

You can pass in a project name into the URL to auto-populate the project dropdown. If there are duplicate project names, the dropdown will ignore this query string parameter.

?project=Demo

Specify other default field values

Use system field names to populate other form fields, using the same {"name": value} notation used for the API. For example:

?defaults={"content":"testing","sg_status_list":"ip"}

Project names with spaces

Any Project names that have spaces in them (i.e., "Demo Project X") should have the spaces’ URL encoded and replaced with %20. For example:

https://{your shotgun base url}/new/Asset?project=Demo%20Project%20X&defaults={"content":"testing","sg_status_list":"ip"}

New Note form URL with defaults

You can pass in text into the URL to populate the actual Note. For example:

https://example.shotgunstudio.com/new/Note?project=Demo Project&defaults={"content": "This is a test note subject with a\nline break.","sg_status_list":"ip"}

Multi-Entity field values

For multi-entity fields that accept multiple values like Ticket.addressings_cc, the syntax would look like this:

https://example.shotgunstudio.com/new/Ticket?project=Demo%20Project&defaults={"addressings_cc":[{"type":"HumanUser","name":"John%20Magoo"}]}
Pro tip: You can also create a page or widget with a filter saved that has all those values in it. For example, if you have a Shot widget, and the filter is “Sequence is Seq_001”, whenever you create a Shot from that widget, the “Sequence” field would already be populated with “Seq_001.”
Follow

13 Comments

  • 0
    Avatar
    Armando Ricalde

    Nice Feature!

    But, I'm trying to populate Cc field in a 'Create New Ticket' form without success

    ?defaults={"addressings_cc":"Name"}

    I've tried with the 'Name', 'Username' and 'Id' of an existing user and all I get is ', , , , ', and when I click on the field it turns into 'undefined, undefined, undefined'

    Am I a doing something wrong or Is this a bug?

    I could populate other fields succesfully.

     

     

     

  • 0
    Avatar
    KP

    addressings_cc is a multi-entity field which means the value needs to be an Array []. Plus, the syntax for entities is a bit more complex at the moment. Try something like this:

    https://example.shotgunstudio.com/new/Ticket?project=Demo%20Project&defaults={"addressings_cc":[{"name":"John%20Magoo"}]}

  • 1
    Avatar
    Patrick Wolf

    would be very cool if the gear menu on the new entity page would have a option: "get form as URL" which would generate a URL for a pre-filled form... as generating the URL by hand takes some trial and error.

    Thanks,

    Patrick

  • 0
    Avatar
    Chris Mihaly

    Okay, so how do you do a note_links field?  I now it is an array, but if I want to tie to a shot.  I tried note_links:[{"name":"01.0/001.00"}]} and it seemed

    to work but the links field didn't look quite right and when I went to save it said the links field was incorrect and fix.  

     

    Also, can I use the project code instead of the full project name?

    Thanks

      Chris

  • 0
    Avatar
    Pmfiebig

    Is there any way to pass the path for an attachment using this method?

     

    Thanks

    Paul

  • 0
    Avatar
    Mathieson Facer

    I am trying to pass a local file link when creating a new Version using this method, but it is resulting in an error.

    "sg_uploaded_movie":{"local_path":<path to the .mov file>}

    Am I doing something wrong?

  • 0
    Avatar
    Bonsak Schieldrop

    I have the same problem as Mat. I dont get an error (Firefox) when passing values like this but i cant make the "Uploaded Movie" field to take the value i pass to it.

     

    Cheers

    Bonsak

  • 0
    Avatar
    KP

    I've updated the docs to show that you need to specify the "type" when providing values to multi-entity fields.

  • 0
    Avatar
    Carlos Alberto Garcia Martinez

    Hi everyone 

    Thanks in advance for all your help, I am trying to populate the field "tag_list" with

    http://example.shotgunstudio.com/new/CustomEntity?project=Demo&defaults={"tag_list":["Template"]}

    But the field is always empty, What Am I doing wrong?

  • 0
    Avatar
    Stephen Chiu

    Carlos, the following revised line should work for you (note that the tag would need to exist in Shotgun in order for it to work accordingly): 

    http://example.shotgunstudio.com/new/CustomEntity?project=Demo&defaults={"tag_list":[{"type":"Tag","name":"Template"}]}

     

  • 0
    Avatar
    Jacob Medendorp

    Is there a way to stop the Confirm Navigation pop from happening when the tab in the browser is closed?

    Currently, after we submit a new entry, the create form window stays open. Then when you try to close the tab, it says "You have entered some text on this page. If you choose to proceed, you will lose your changes.  Are you sure you want to leave this page?"

  • 1
    Avatar
    Jacob Medendorp

    Any way to use project ID instead of project name?

  • 0
    Avatar
    Robby Ronk

    The Confirm Navigation popup is a problem for us as well. Were you able to find a work around, Jacob?

Please sign in to leave a comment.