Forum Discussion

smpa01's avatar
smpa01
Community Champion
2 years ago
Solved

Progrmatically get NB path/directory

Is it possible to retrieve progrmatically the current path/directory of the notebook; the following does not return the desired   notebookutils.notebook.get('NB1')    
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi smpa01,

    In fact, this code is used to get the detail information of notebook instead of path/directory.

    {'id': 'xxxxxxx',
     'type': 'Notebook',
     'displayName': 'notebook name',
     'description': 'New notebook',
     'workspaceId': 'xxxxxxxx',
     'properties': {}}

    You can extract the 'id' and 'workspace id' properties to concatenate the relative path: groups/{workspace id}/synapsenotebooks/{noteboke id}.

    Regards,

    Xiaoxin Sheng