Viva Engage Campaign Cross-Post Scheduler
When a campaign post is approved in a SharePoint content calendar, the flow publishes it to the relevant Viva Engage communities on schedule, pins important posts, cross-posts to Teams, and tracks reactions/replies into Dataverse for an engagement report. Coordinates internal campaigns across communities from one approved source.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This solution coordinates internal campaigns on Viva Engage from a single approved source. Approved campaign posts live in a Dataverse content-calendar table; on a schedule the Campaign Publisher flow publishes each due post to its target Viva Engage community, cross-posts to Teams, and marks it Published. A second Engagement Tracker flow runs daily, reads reaction counts from each published post's community, and logs an engagement snapshot for reporting.
Why it matters: Internal campaigns lose impact when posted inconsistently across communities. Driving them from one approved calendar with engagement tracked centrally ensures coordinated, measurable reach.
> Build note — Dataverse content calendar (not SharePoint). This build uses a Dataverse table (flowlibs_campaignpost) as the content calendar, the more portable connector-first choice. To use a SharePoint list instead, swap the Dataverse ListRecords/UpdateRecord actions for SharePoint GetItems/UpdateItem and point flowlibs_CampaignTable at the list.
> Viva pinning limitation. The Viva Engage (Yammer) connector has no "pin message" operation. The flowlibs_pinimportant flag is honored by flagging the cross-posted Teams message as a Pinned campaign; pinning inside Viva Engage itself must be done manually or via a Graph call if/when available.
Use Case
A comms team running internal campaigns maintains a content calendar of approved posts. They want each post published to the right communities on schedule, echoed into Teams, and engagement tracked automatically for a weekly report — without anyone hand-posting or hand-counting reactions.
Flow Architecture
Every 15 Minutes
Recurrence (15 min)Poll for due approved campaign posts in the Dataverse content calendar.
Initialize run variables
Initialize variableMint a guid() correlation/trace ID and load fallback community, Teams group and channel IDs.
List Approved Posts
Dataverse ListRecordsRead campaign posts where Status = Approved.
Apply to each due post
Foreach + ConditionFor each post where ScheduledTime <= now, post to the target Viva Engage community (PostMessage), cross-post to Teams when flagged (PostMessageToConversation), then update the post to Published with message/correlation IDs.
Engagement Tracker (daily)
Recurrence + Dataverse + Viva EngageA second daily flow lists Published posts, reads community messages/reactions via GetMessagesInGroupV3, and writes an engagement snapshot record carrying the correlation ID.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_CampaignTable | String | flowlibs_campaignposts | Content-calendar table (entity set) |
| flowlibs_EngagementTable | String | flowlibs_vivaengagements | Engagement-log table (entity set) |
| flowlibs_TargetCommunities | String | ["0000000"] | JSON array of community IDs (fallback target) |
| flowlibs_DefaultCommunityId | String | 0 | Final fallback community (0 = All Company) |
| flowlibs_TeamsGroupId | String | <configure> | Teams team ID for cross-post |
| flowlibs_TeamsChannelId | String | <configure> | Teams channel ID for cross-post |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Viva Engage | shared_yammer | PostMessage GetMessagesInGroupV3 |
| Microsoft Teams | shared_teams | PostMessageToConversation |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords CreateRecord UpdateRecord |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Approval gate
- Add an Approvals StartAndWaitForAnApproval step before a post flips to Approved, or drive Status from a model-driven app.
- Multiple communities per post
- Replace the single flowlibs_communityid with a child table or a JSON array column and loop the PostMessage over each.
- Cadence
- Tighten or relax the Publisher recurrence (currently 15 min) and the Tracker recurrence (currently daily).
- Engagement report
- Add a weekly Recurrence flow that aggregates flowlibs_vivaengagement and emails a summary via Outlook.
- True Viva pin
- When a pin API is available, add it after Post_To_Viva_Community gated on flowlibs_pinimportant.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Due filter (Condition)
Only act when the scheduled time has passed.
EXPR.02Community resolution
Resolve the target community with fallbacks.
EXPR.03Cross-post gate
Echo to Teams only when flagged.
EXPR.04Match published message
Find the published message for engagement tracking.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.