Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
hvdbunte
Frequent Visitor

OneDriveSharePoint shortcut with library variables error

I try to dynamicly change the target subpath of the onedrive sharepoint connector for my environments (dev/test/ etc) So I would like to replace the target subpath with a library variable.

hvdbunte_1-1778498053033.png

 

hvdbunte_2-1778498225193.png

my variable value:

hvdbunte_4-1778498429345.png

But when I change the target subpath value to the above library variable I get below error:

hvdbunte_5-1778498513860.png

Can somebody explain if this is still an issue because the connector is still in preview? Or how I could fix the syntax?

Kind regards,

 

1 ACCEPTED SOLUTION

Hi @hvdbunte ,

Thank you for contacting the Microsoft Fabric community forum.

 

Yes, I think the API approach will fit much better once you start separating dev/test/prod environments. From your screenshots and the 400 error, it looks less like a syntax mistake and more like a limitation of variable substitution for SharePoint shortcut subpath values in the UI. The static path works, but the validation seems to fail when the variable is injected. With the REST API, you can simply generate the correct path during deployment instead of relying on UI interpolation.

Example:

POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{lakehouseId}/shortcuts
{
"path": "Files",
"name": "dev",
"target": {
"sharePoint": {
"connectionId": "<connection-id>",
"location": "https://contoso.sharepoint.com/sites/project",
"subpath": "General/import/dev"
}
}
}

 

Then in your pipeline/script you only swap the environment value:

General/import/dev

General/import/test

General/import/prod

 

Also, Please refer to:

OneLake Shortcuts APIs available in Preview - Microsoft Fabric Community

OneLake Shortcuts - Create Shortcut - REST API (Core) | Microsoft Learn

Assign variables to shortcuts - Microsoft Fabric | Microsoft Learn

 

If I’ve misunderstood your needs or if you still encounter issues, please let us know.

Best Regards, 
Community Support Team

View solution in original post

7 REPLIES 7
v-menakakota
Community Support
Community Support

Hi @hvdbunte ,
Thanks for reaching out to the Microsoft fabric community forum. 


I would also take a moment to thank  @Tamanchu  , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference. 
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you.

Best Regards, 
Community Support Team

Hi @hvdbunte ,

I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you.

Best Regards, 
Community Support Team

Tamanchu
Impactful Individual
Impactful Individual

Hi @hvdbunte,

 

This looks more like a current limitation of Variable Library support in certain shortcut properties than an actual syntax issue on your side.

The behavior you’re seeing is pretty consistent with what we currently observe with OneDrive/SharePoint shortcuts:
variables are supported in some contexts, but the target subpath does not always seem to get properly re-resolved after interpolation.

In other words :

The static path works, but as soon as a Variable Library value is injected into the subpath, the shortcut validation can fail before the variable is fully resolved.

 

And yes, there’s already quite a bit of community feedback around this behavior.

A few possible approaches :

  1. Manually run "Update All Variables"
    In some cases, you need to force a variable refresh on the Lakehouse side for the shortcut to pick up the latest values.
  2. REST API / automated provisioning
    Probably the most robust approach for multi-environment setups (dev/test/prod) : recreate the shortcuts dynamically with the correct subpaths per environment.
  3. Terraform / IaC
    Also a very clean option if you’re already industrializing your Fabric deployments.
  4. Variables + manual refresh
    Can work… with a bit of friction 😅

Curious to know : are you staying UI-only for shortcut management, or are you also testing the Fabric API approach? 👀

 

Docs:

Variables in shortcuts: https://learn.microsoft.com/fabric/onelake/assign-variables-to-shortcuts

Hi @Tamanchu ,

Thank you for the solutions, I have to dive in the api's and see if that could work for us.

Currently we are starting with usting sharepoint so I don't have much experience yet how to integrate this properly into our test/acc/prod. So I started with the UI to see how this could work.


Can you maybe show an example of how you use the rest api for automated provisioning? 

Kind regards

Hi @hvdbunte ,

Thank you for contacting the Microsoft Fabric community forum.

 

Yes, I think the API approach will fit much better once you start separating dev/test/prod environments. From your screenshots and the 400 error, it looks less like a syntax mistake and more like a limitation of variable substitution for SharePoint shortcut subpath values in the UI. The static path works, but the validation seems to fail when the variable is injected. With the REST API, you can simply generate the correct path during deployment instead of relying on UI interpolation.

Example:

POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{lakehouseId}/shortcuts
{
"path": "Files",
"name": "dev",
"target": {
"sharePoint": {
"connectionId": "<connection-id>",
"location": "https://contoso.sharepoint.com/sites/project",
"subpath": "General/import/dev"
}
}
}

 

Then in your pipeline/script you only swap the environment value:

General/import/dev

General/import/test

General/import/prod

 

Also, Please refer to:

OneLake Shortcuts APIs available in Preview - Microsoft Fabric Community

OneLake Shortcuts - Create Shortcut - REST API (Core) | Microsoft Learn

Assign variables to shortcuts - Microsoft Fabric | Microsoft Learn

 

If I’ve misunderstood your needs or if you still encounter issues, please let us know.

Best Regards, 
Community Support Team

Hi @v-menakakota,

 

Thank you for the detailed reply. I will have to test en implement this. But it looks very promising.

Kind Regards,

hvdbunte

Hi @hvdbunte ,

I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you.

Best Regards, 
Community Support Team

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

June Fabric Update Carousel

Fabric Monthly Update - June 2026

Check out the June 2026 Fabric update to learn about new features.