RV Submit Tool - Pre-fill fields based on Context

We’ve been users of RV’s Submit tool for quite a while now, and I’m looking at ways to make it more easier to use for our user. One thing that comes to mind is to pre-fill fields based on Context.

While making this post, I was looking at the shotgrid_review_app.mu file and found the method internalLaunchSubmitTool indicating:

// Open the submit tool. The given list of urlArgs contains pairs that define
// query items that should be passed via the url to the page. This allows
// the submit tool to be opened with a given context (to prepopulate form
// fields, etc).

That sounds great and all but I didn’t found any info yet related to those query items, and there are not a lot of documentation around RV’s Submit Tool…

Any guidance ?

Hey @sbissonnette thank you for reaching out. My name is Tommy I am the Senior PM for review including RV at Autodesk. To help answer your question. The Submit tool isn’t a native RV form — it’s a web page served by your ShotGrid / Flow Production Tracking site (/page/review_app_submit), loaded inside an embedded web view. The urlArgs you pass are simply appended as URL query-string parameters to that page. RV forwards them untouched; the page decides what to do with them. That’s why you won’t find a list of valid keys in the .mu — the accepting side is server-side, and the valid keys track your SG/Flow server version, not your RV version. On the RV side, args are passed straight through as query parameters:

    method: internalLaunchSubmitTool(void; [(string, string)] urlArgs = nil)
    {
        ...
        QUrl desiredUrl = QUrl("/page/review_app_submit");
        QUrlQuery desiredUrlQuery = QUrlQuery();
        for_each(urlArg; urlArgs) {
            desiredUrlQuery.addQueryItem(urlArg._0, urlArg._1);
        }
        desiredUrl.setQuery(desiredUrlQuery);

Supported urlArgs keys

These are the only query parameters the submit page reads:

Key Type Purpose
task_id Entity ID Pre-select a Task; entity, step, and project are derived from it
entity_type Entity type string Link entity for the Version (e.g. "Shot", "Asset") — must be paired with entity_id
entity_id Entity ID ID of the link entity — must be paired with entity_type
step_id Entity ID Optional pipeline Step; used with entity_type/entity_id to guess the Task
project_id Entity ID Pre-select Project only (when no task and no entity link are given)
qt_output_path File path string Where RV should write the exported QuickTime; should be URL-encoded

There is no support on this page for timeline-only params like version_id or asset_type (those belong to /page/review_app_browser).

Valid combinations

From the Ruby controller logic:

  1. No args — empty submit form
    Example: internalLaunchSubmitTool();

  2. Task contexttask_id alone
    Example: [("task_id", "12345")]

  3. Entity linkentity_type + entity_id, optionally + step_id
    Example: [("entity_type", "Shot"), ("entity_id", "678"), ("step_id", "90")]

  4. Project onlyproject_id alone (when task_id and entity_type/entity_id are absent)
    Example: [("project_id", "42")]

  5. QuickTime path — can be added to any of the above
    Example: [("entity_type", "Shot"), ("entity_id", "678"), ("qt_output_path", "/path/to/output.mov")]
    (URL-encode the path; the JS side runs decodeURIComponent on it.)

What each arg pre-populates in the form

The server resolves params into a @context hash (task, entity, project, step, qt_output_path), and the JS widget uses that in init_widget() / set_defaults():

  • task_id → Task, linked entity, and project fields
  • entity_type + entity_id → Project (from entity) and link entity; if no task, it queries matching Tasks and picks the best guess (especially when step_id is set)
  • step_id → narrows the Task search when used with entity link
  • project_id → Project field only
  • qt_output_path → export destination for the generated movie (not a form field)

Example Mu urlArgs values

// Submit linked to a specific Task
[(string, string)] {("task_id", "12345")}

// Submit for a Shot, guessing Task from pipeline step
[(string, string)] {("entity_type", "Shot"), ("entity_id", "678"), ("step_id", "90")}

// Submit with a custom QuickTime output path
[(string, string)] {("entity_type", "Asset"), ("entity_id", "100"), ("qt_output_path", "/tmp/review_output")}

Caveats

The Ruby code itself warns that parameter combinations are flexible and somewhat undocumented — invalid combos can fail silently or behave unexpectedly. In practice:

  • entity_type and entity_id must be supplied together.
  • step_id only makes sense with entity_type + entity_id.
  • project_id is only used when neither task_id nor entity_type/entity_id are provided.
  • qt_output_path should be URL-encoded when it contains spaces or special characters.

If you’d be up for it we would love to better understand what we can do on our end to optimize the workflow you are trying to achieve.

Great thanks for all the details Tommy!

I’ll give it a try and provide feedback from my explorations!

Not being a Mu specialist myself, I’m just trying to force a task to be set by default but it doesnt seem to work…

method: internalLaunchSubmitTool(void; [(string, string)] urlArgs = nil)
    {
        deb("INFO: internalLaunchSubmitTool()\n");

        let defSession = getDefaultSessionFromSLUtils();
        _sessionUrl = if (defSession._0 eq nil) then "" else defSession._0;

        if ( _sessionUrl != "") {
            // this is an old function that changes the prefs
            shotgrid.theMode().setServerURLValue(_sessionUrl);
        }

        // The url for the submit tool
        QUrl desiredUrl = QUrl("/page/review_app_submit");
        
        // Forcing Task for testing purposes
        let urlArgs = [("task_id", "413957"), ("project_id", "16199")];
        
        // Add the context query items to the url
        QUrlQuery desiredUrlQuery = QUrlQuery();
        for_each(urlArg; urlArgs) {
            print("DEBUG: %s,%s\n" % (urlArg._0, urlArg._1));
            desiredUrlQuery.addQueryItem(urlArg._0, urlArg._1);
        }
        desiredUrl.setQuery(desiredUrlQuery);

I also added debug prints to see if my edits are really being picked up. I can confirm my changes are understood.

Am I missing something?

Hello @sbissonnette !

I tested it on my end as well and like you, I wasn’t able to prefill the Task. After investigation, it turns out that what is preventing this from working correctly is not on the RV end but on the Flow Production Tracking (Web) side of things. I will propose a fix to the Flow Production Tracking (Web) team to unlock this useful capability. I’ll keep you posted.

That is great to hear @bernie that you were able to reproduce the issue on your end!

While being at it, is there a way to defaults the Submit Tool web page to defaults on the “Other” tab rather than the “My Tasks”?

I’m asking this question because we are working on really fast paced projects and its not unusual that some Tasks are not assigned to Artists. Our Production Team tries their best to do so, and we have tools trying to help on this as well, but our users always use the “Other” section because of this exact reason.

So if the Prefill feature gets fixed, I fear that it still won’t get filled properly because the “My Tasks” tab is focused by default, and Tasks assigments might not be done properly…

What do you think?

Great idea ! I have added it to my PR.

From RV, you will be able to pre-select the Other tab using the following query parameter:

urlArgs = [(“tab”, “other”)];

Note that my PR still needs to go through code reviews and testing. So it might take a week or two before it becomes active if my PR gets accepted. I will keep you posted.

Thanks for the excellent feedback @sbissonnette !

Amazing! Looking forward for these fix and new features!

FYI @sbissonnette : The fix has just been deployed to all Flow Production Tracking sites.

Thank you for letting me know!

I’ll give it a try when I’ll be back from vacation and let you know how it goes!