Publish Stamps to Dynamics 365
publish_to_dataverseMicrosoft Copilot (Entra sign-in): writes stamped point-layer columns back to Dynamics 365 account records keyed by accountid (1:1 Account PATCH). Needs map_session_id or ts_handle. Point layers carry derived stamps from builds/realign (part_id, territory_id, territory_label), calculate_route (route_id, route_label, stop_sequence), schedule_visits (schedule_id, visit_count, schedule_days, schedule_dates, contractor_id, contractor_label), isochrone_build (isochrone_tal_id, isochrone_ids, isochrone_labels, isochrone_count), and cluster_points (group_id, group_label). A <point_layer>_visits layer resolves to its 1:1 parent account layer and maps schedule_day/date to schedule_days/dates. field_map maps point columns to Dynamics account logical attributes (primitive columns or territoryid / ownerid lookups resolved by name or GUID). With confirm=false (default) or no field_map, runs a read-only preflight returning status=confirmation_required, stamped_columns, candidate_target_attributes, preview_updates, and ask_user. With confirm=true, queues the batch PATCH task.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | False (default) runs the read-only preflight to preview matched accounts and validate attributes/lookups. True dispatches the batch PATCH job after user confirmation. | |
| field_map | No | Map of stamped point column -> Dynamics 365 account logical attribute name (e.g. {'territory_label': 'territoryid', 'route_label': 'new_routename'}). When absent, the preflight lists stamped_columns and candidate_target_attributes. | |
| ts_handle | No | Territory Solution reference (tsh_...) from a build, ingest_accounts, import_geojson, import_designer_project, or get_map_visualization; Territory Solutions are not accepted inline. | |
| point_layer | No | Source point layer in the Territory Solution (default 'accounts'). A <point_layer>_visits layer resolves to its 1:1 parent account layer. | accounts |
| map_session_id | No | Open map session (msess_...) from get_map_visualization. Its Territory Solution is the input; omit ts_handle when set. | |
| environment_url | No | Dynamics 365 environment (e.g. https://contoso.crm.dynamics.com). Defaults to the environment the point layer was imported from, or the user's sole environment. | |
| include_unassigned | No | When true, accounts with an empty/unassigned stamp clear the target Dynamics attribute to null. Default false updates accounts with non-empty stamped values. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | Present when ok is false. | |
| result | No | Present when ok is true. A submission returns the task reference (task_id, next_action, sleep_ms); the completed task result carries the remaining fields. | |
| warnings | No |