function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Adarsh G 6Adarsh G 6 

Get community name from flow

Hi,

I have 2 communities with same profile. A customer can be part of both the profiles.  I want a flow to run only if the customer is logged in one of the community. Any idea how to achieve this? Is there a global variable where I can get the id of currently logged in community?

I know we can query Network sobject to get the community name. But how do we get the id of community to which the user has logged in?

Thanks
SwethaSwetha (Salesforce Developers) 
HI Adarsh,

You can query the community Id too from the Network Sobject.
SELECT ID, NAME FROM NETWORK
Let me know if you have any follow up queries.

Related: https://help.salesforce.com/articleView?id=000333416&type=1&mode=1

​​​​​​​Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Adarsh G 6Adarsh G 6
Hi Swetha,
Thanks for the quick response. I want to achieve this in screen flows. I have 2 communties for the same profile. I want screen flow to execute only for one of the community. Hence I want to know to which community the user has logged in. How can I get the community info in screen flows?
Thanks