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

How to get the Sheet ID

Hello, 

I am looking to make a single Chart present different measures based on the Sheet it is located on. I found that DocumentName() provides the App portion of the URL, but I can't find a function that yields the Sheet. For instance, in the URL below, I want to return b1fd7972-dbfe-4c7a-97cf-b97b85bbbb17

/sense/app/ea22d26d-d927-4808-a3a5-81f259b02688/sheet/b1fd7972-dbfe-4c7a-97cf-b97b85bbbb17/state/edit

Any suggestions?

Thanks in advance for your help,

Chris

 

 

Labels (4)
1 Solution

Accepted Solutions
AnsweringTuring
Contributor III


To get the sheet ID from the URL, you can use the ObjectId('sheet') function. This function returns the ID of the sheet where the visualization is located. The sheet ID follows after '/sheet/' in the URL.

For example, if the URL is:
https://example.com/sense/app/guid/sheet/b1fd7972-dbfe-4c7a-97cf-b97b85bbbb17/state/analysis

Then the expression =ObjectId('sheet') will return 'b1fd7972-dbfe-4c7a-97cf-b97b85bbbb17', which is the sheet ID.

You can use this sheet ID in expressions to conditionally show or hide measures based on the current sheet. The ObjectId() function can be nested inside other expressions like if() or combined with functions like InObject() to create conditional logic.

View solution in original post

4 Replies
mpc
Partner Ambassador

Hi Chris, 

AFAIK, it's not possible without API call, and then a custom extension. 
Nevermind, I though it was the title needed !

Kind regards

From Next Decision and mpc with love
AnsweringTuring
Contributor III


To get the sheet ID from the URL, you can use the ObjectId('sheet') function. This function returns the ID of the sheet where the visualization is located. The sheet ID follows after '/sheet/' in the URL.

For example, if the URL is:
https://example.com/sense/app/guid/sheet/b1fd7972-dbfe-4c7a-97cf-b97b85bbbb17/state/analysis

Then the expression =ObjectId('sheet') will return 'b1fd7972-dbfe-4c7a-97cf-b97b85bbbb17', which is the sheet ID.

You can use this sheet ID in expressions to conditionally show or hide measures based on the current sheet. The ObjectId() function can be nested inside other expressions like if() or combined with functions like InObject() to create conditional logic.

cfountain72
Creator II
Author

Thanks for your help! That was easier than expected. The Qlik documentation doesn't seem to show that this can be done.

seanbruton
Luminary Alumni

Kudos nice solution!!