Canonical Layout Names

In https://github.com/datagrok-ai/public/blob/master/help/develop/how-to/layouts.md, you talk about being able to send files and layout information to datagrok. How does one find the canonical name for the layout to include in the api call?

If the layout has been saved, it can be found by id or view name (or other layout properties passed to filter):

const view = grok.shell.v;
const layout = view.saveLayout();
await grok.dapi.layouts.save(layout);

// find by id or view/table name
const res1 = await grok.dapi.layouts.find(layout.id);
const res2 = await grok.dapi.layouts.filter(`name = "${view.name}"`).first();

Hope I understood your question correctly :slight_smile:

Hi Ed, I think this is the help page you were looking for. I’ve also cross-linked these pages, and added some pictures.

I’ve also just made an improvement that would make it a lot easier to get layout’s id. Once saved, a layout will appear in the property panel. But this will only appear in the next release :slight_smile:

Also, we’ve added the “information” icon for layouts in the “Layouts” panel. Click on it to put the layout in the property panel.

@skalkin @donufriienko - We are getting an error when applying the layout to an upload. We are applying the layout ID to the upload url and that process if finishing fine but when visiting the url after, we are getting the following error:

Here is a screenshot

Is the url correct? When visiting the returned url from the upload POST, is the layout id suppose to be a query param?

Thanks