Canvas Data how to Query if a module is published

Jump to solution
WillGHampton
Community Explorer

This is in reference to querying Canvas data with SQL. Where/what field and table contains if a module is published to student view?

When one views a course as student, one can see published modules. I need a count of this.

The following query gives a count of modules that are in the course, published and unpublished.

select count(distinct module_dim.id)
from module_dim

where module_dim.course_id=9999

What and clause do I need to exclude unpublished modules? Would I need to join another table?

I've searched through the schema(https://portal.inshosteddata.com/docs) and cannot find a field that indicates if a module is published or not. Seems like it should be in module_dim but is not.

Thanks

Labels (1)
0 Likes
1 Solution
robotcars
Community Champion

Hi @WillGHampton 

module_dim.workflow_state has: unpublished, active, deleted

View solution in original post

0 Likes