Flag
A Flag in Salesforce is a marker that surfaces a piece of content or a record for human review without taking any action on it.
Definition
A Flag in Salesforce is a marker that surfaces a piece of content or a record for human review without taking any action on it. The most formal version lives in Experience Cloud, where a community member can flag a post, comment, file, or message as inappropriate. Each member flag is stored as a NetworkModeration record, and a site moderator decides what happens next. A flag is a request for attention, not an enforcement step.
The word also covers lighter patterns. Salesforce Knowledge lets readers flag an article for review when it looks wrong or out of date. Admins often build a custom checkbox field, such as Flag_for_Manager_Review__c, to drive list views, reports, and Flow logic. The shared idea across all of these is the same: a flag says "someone should look at this," and a person or a rule has to follow up.
How a flag travels from a member click to a moderator action
The member flag flow in Experience Cloud
Community flagging is the canonical use of Flag in Salesforce. When you turn on the "Allow members to flag content" setting in the Administration workspace, members see a flag option in the action menu on posts, comments, files, and messages. A member who flags an item is reporting it as inappropriate or off-topic. The item is not hidden or deleted at that moment. Nothing visible changes for other members yet. Each flag creates a record that a site moderator can review. Moderators open the Moderation area in Experience Workspaces and work through flagged items from the Home tab. From there a moderator can remove the flag and leave the content, or delete the post or comment outright. The moderator is the decision point, so the system depends on having people assigned to that role. A common rollout mistake is enabling member flagging without assigning moderators, which lets flags pile up with no one acting on them. Set a clear owner and a response target before you switch flagging on.
NetworkModeration: the object behind every flag
Behind the scenes, a community flag is a row in the NetworkModeration object. Salesforce describes NetworkModeration as a flag on an item in a community, and it has been queryable through the API since version 30.0. Each record ties a flag to the flagged entity and to the Experience Cloud site (the Network) it belongs to. That makes flags real data you can query, report on, and automate against, rather than a hidden UI state. Because flags are records, you can build reporting and process around them. A SOQL query against NetworkModeration tells you which posts have open flags and how many flags each one carries. You can surface that in a moderator dashboard or feed it into a custom review screen. Deleting the underlying content removes its flags, and a moderator dismissing a flag clears the record. Treating flags as data is what lets larger communities move past manual queue-watching. It also gives compliance teams a concrete trail of what was reported, which matters when a site has obligations around user-generated content.
Member flags versus automated moderation rules
Member flagging is reactive. It catches problems only after a person notices and reports them, so it works best for judgment calls that software cannot make on its own. To catch the obvious cases automatically, Salesforce pairs flagging with moderation rules. A content rule scans member posts and comments for banned keywords or disallowed links and can block, replace, review, or flag the content as it is created. The ModerationRule type in the Metadata API defines which content the rule covers, the criteria it enforces, and the action it takes. The two mechanisms are meant to run together. Rules handle high-volume, pattern-matchable problems like profanity and spam links without waiting for a human. Member flags handle the contextual issues that rules miss, such as a technically clean post that is still off-topic or unkind. Rate rules add a third layer by limiting how fast a member can post, which slows spam floods. A healthy moderation setup uses rules for the predictable noise and reserves human attention for the flags that genuinely need a person to weigh in.
Flagging Knowledge articles for review
Salesforce Knowledge has its own flagging idea aimed at article quality rather than community behavior. When an article is wrong, stale, or incomplete, a reader or agent can flag it so the right people revisit it. On a public Knowledge base served through Experience Cloud, this often appears as a way to report an article as inappropriate or unhelpful. Inside the org, agents and reviewers can mark articles that need a fresh look before the next publish cycle. The value here is keeping your knowledge base honest over time. Articles drift out of date as products change, and the people who notice are usually the readers, not the original authors. A Knowledge flag turns that noticing into a tracked signal instead of a lost comment. Route flags to article owners or a Knowledge moderator, and decide on each one: revise the article, archive it, or dismiss the flag because the content is actually correct. Without that follow-up step, a flag is just an opinion. With it, flagging becomes a steady feedback loop that improves article accuracy.
Custom Flag fields admins build on objects
Outside the built-in features, "flag" is also everyday admin shorthand for a custom checkbox that marks a record for attention. Teams create fields like Flag_for_Manager_Review__c on Lead, Needs_Attention__c on Case, or a priority flag on Opportunity. These are ordinary custom fields with no special platform behavior. Their power comes from what you build around them. A custom Flag field drives three common patterns. It powers list views that show only flagged records, so a manager opens one filtered view instead of scanning everything. It feeds reports that count flagged records by owner, region, or reason. And it triggers automation: a record-triggered Flow can notify a manager, create a task, or reassign ownership the moment the box is checked. Because the field is just metadata, you control who can see and edit it through field-level security, and you can default it to unchecked. The trap is reaching for a custom field first. For community content, the built-in moderation flag is usually the better fit, so use a custom Flag field when no native flagging feature covers your case.
Automating flags with Apex and the Connect API
Developers can read and write community flags programmatically, which is how larger sites scale moderation. Because NetworkModeration is a real object, Apex triggers can fire when a flag is inserted. A trigger on NetworkModeration lets you react to a new flag in real time: notify a moderator over a custom channel, auto-hide content once it passes a flag threshold, or log the event to an external compliance system. This moves moderation from manual queue-watching toward rules you define in code. The Connect API (Chatter REST API and ConnectApi in Apex) exposes moderation as well, so you can flag items and read flagged feeds from integrations or custom Lightning components. That is useful when you build a bespoke moderation console or surface flag counts inside a community page. Keep the human in the loop for destructive actions. Auto-flagging and notifications are safe to automate, but deleting content based purely on flag count can punish a member who was simply unpopular in one thread. Use code to triage and route flags quickly, and leave the final delete-or-dismiss decision with a trusted moderator.
How to enable member flagging on an Experience Cloud site
Turn on member flagging for an Experience Cloud site so community members can report inappropriate posts, comments, files, and messages, and so moderators can act on them. Do this in Experience Workspaces for the site.
- Open the site's Administration workspace
In Experience Workspaces for your site, go to Administration, then Preferences. This is where the member-flagging toggle lives.
- Allow members to flag content
Enable the "Allow members to flag content" setting and save. Members now see a flag option in the action menu on posts, comments, files, and messages.
- Assign at least one moderator
Give the moderator permissions (such as Moderate Experience Cloud Feeds) to the users who will review reports, so flagged items have an owner.
- Review flagged items in Moderation
From the Moderation Home tab, open flagged items and either remove the flag to keep the content or delete the post or comment.
- Add moderation rules for the obvious cases
Create content rules to block or flag banned keywords and links automatically, so member flags are reserved for judgment calls.
The core preference that exposes the flag action to community members; off by default.
Users need a moderation permission to see and act on the flagged-items queue.
Optional rules that block, replace, review, or flag content by keyword or link as it is posted.
Configure whether moderators get notified when content is flagged so response time stays short.
- Flagging does nothing without assigned moderators; flags accumulate unreviewed if no one owns the queue.
- A flag does not hide or delete content on its own. Only a moderator action or a moderation rule changes what members see.
- Member flagging covers community content. It is unrelated to custom Flag checkbox fields you build on standard objects.
Trust & references
Cross-checked against the following references.
Straight from the source - Salesforce's reference material on Flag.
Hands-on resources to go deeper on Flag.
About the Author
Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.
Test your knowledge
Q1. What does Flag do in Chatter?
Q2. Where is Flag most important?
Q3. What complements user flagging?
Discussion
Loading discussion…