microsoft / Microsoft-Fabric-workload-development-sample

Demonstrates how to implement a Microsoft Fabric workload in .net and typescript
Other
30 stars 16 forks source link

No way to get current workspace from workload item editor page #20

Closed box-turtle closed 4 months ago

box-turtle commented 5 months ago

When Fabric loads your workload item it uses the URL

  /myWorkloadPath/{itemId}

So you have access to the item id. But I am stumped on how I might retrieve the current workspace id inside the workload item editor page. Is there any API to retrieve the current workspace id?

Was hoping to see some guidance here in the sample:

https://github.com/microsoft/Microsoft-Fabric-workload-development-sample/blob/main/Frontend/src/components/SampleWorkloadEditor/SampleWorkloadEditor.tsx#L649

anitamayorov commented 4 months ago

Hi @box-turtle,

You can use getItem in ItemCrudAPI to get the item details, part of the response is the foldetObjectId representing the workspace id the item is part of.

box-turtle commented 4 months ago

ah ok. folder = workspace in this case.

On Tue, Jun 25, 2024 at 5:02 AM anitamayorov @.***> wrote:

Hi @box-turtle https://github.com/box-turtle,

You can use getItem in ItemCrudAPI to get the item details, part of the response is the foldetObjectId representing the workspace id the item is part of.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/Microsoft-Fabric-workload-development-sample/issues/20#issuecomment-2188363178, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6QP72XESR7FT7BG4J6G5DZJEW2TAVCNFSM6AAAAABJ2B3LO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBYGM3DGMJXHA . You are receiving this because you were mentioned.Message ID: <microsoft/Microsoft-Fabric-workload-development-sample/issues/20/2188363178 @github.com>