Module dropdowns not populating with SQL data when report shared as public link

I have a simple module which is a dropdown with the options populated by a SQL query, filtering on a user id.

campaignsQuery

select
  campaigns.id,
  campaigns.name
from
  campaigns
join users on users.id = {{userId.value}} and users.status = 'active'
where
  campaigns.status = 'active'
  and exists(select 1 from "campaignUsers" where "campaignUsers"."campaignId" = campaigns.id and "campaignUsers"."userId" = users.id)
group by
  campaigns.id,
  campaigns.name
order by
  campaigns.name

userId is a data input, which defaults to ?ctUserId from the quert string, which is useful for testing, however I explicitly pass this in from my apps.

Screenshot 2023-08-07 at 17.03.41

Screenshot 2023-08-07 at 16.49.49

Screenshot 2023-08-07 at 16.51.29

This all works as expected when editing an app or previewing it, but as soon as I share it as a public link, the dropdown no longer populates.

Any idea why the dropdown wouldn't be populated only in a publicly shared report link?

Set your module which is used in public app to public too.

Your module is need to be shared to public.

1 Like

Ah, that works! Thank you.

1 Like