web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Creating and Updating ...
Power Automate
Unanswered

Creating and Updating records in Dataverse from SharePoint

(0) ShareShare
ReportReport
Posted on by 429
Hello All,
 
I have a SharePoint list that is connected to a Power App. I want to move that data to Dataverse. Eventually, we would like to connect directly to Dataverse but right now the data source for the app is SharePoint. I would like to create a flow that adds or updates data in the Dataverse when a record is created or updated in SharePoint. I have found multiple videos on how to import data from SharePoint to the Dataverse but that's not what I'm looking for. I would like to replicate something similar to Reza Dorrani's video Add & Update Excel Data to SharePoint List using Power Automate. If anyone can point me in the right direction, I would greatly appreciate it!
Categories:
I have the same question (0)
  • Suggested answer
    Ninjasabi Profile Picture
    122 on at
    Creating and Updating records in Dataverse from SharePoint

    To create a flow that adds or updates data in Dataverse when a record is created or updated in SharePoint, you can use Power Automate to achieve this. Here’s a step-by-step guide to help you set up the flow:

    1. Trigger the Flow:

      • Use the "When an item is created or modified" trigger for SharePoint.
      • Site Address: (your SharePoint site)
      • List Name: (your SharePoint list)
    2. Get the Item Details:

      • Action: Get item
      • Site Address: (your SharePoint site)
      • List Name: (your SharePoint list)
      • Id: ID (from the trigger)
    3. Check if the Record Exists in Dataverse:

      • Action: List rows (Dataverse)
      • Table Name: (your Dataverse table)
      • Filter Query: sharepoint_id eq 'ID' (assuming you have a column in Dataverse to store the SharePoint item ID)
    4. Condition to Check if Record Exists:

      • Action: Condition
      • Condition: length(body('List_rows')?['value']) is greater than 0
    5. If Record Exists, Update the Record:

      • Action: Update a row (Dataverse)
      • Table Name: (your Dataverse table)
      • Row ID: first(body('List_rows')?['value'])?['dataverse_id'] (assuming dataverse_id is the unique identifier in Dataverse)
      • Map the fields from SharePoint to Dataverse
    6. If Record Does Not Exist, Create a New Record:

      • Action: Add a new row (Dataverse)
      • Table Name: (your Dataverse table)
      • Map the fields from SharePoint to Dataverse, including the SharePoint item ID

    Here is a more detailed breakdown of the steps in Power Automate:

    1. Trigger:

      • Action: When an item is created or modified
      • Site Address: (your SharePoint site)
      • List Name: (your SharePoint list)
    2. Get Item:

      • Action: Get item
      • Site Address: (your SharePoint site)
      • List Name: (your SharePoint list)
      • Id: ID (from the trigger)
    3. List Rows (Dataverse):

      • Action: List rows
      • Table Name: (your Dataverse table)
      • Filter Query: sharepoint_id eq '@{triggerOutputs()?['body/ID']}'
    4. Condition:

      • Action: Condition
      • Condition: length(body('List_rows')?['value']) is greater than 0
    5. If Yes (Record Exists):

      • Action: Update a row
      • Table Name: (your Dataverse table)
      • Row ID: first(body('List_rows')?['value'])?['dataverse_id']
      • Map the fields from SharePoint to Dataverse
    6. If No (Record Does Not Exist):

      • Action: Add a new row
      • Table Name: (your Dataverse table)
      • Map the fields from SharePoint to Dataverse, including the SharePoint item ID

    This approach ensures that your Dataverse table is updated with the latest data from SharePoint, whether it’s a new record or an update to an existing record.

    If you need further clarification or run into any issues, please let me know!

  • nleuck_101 Profile Picture
    429 on at
    Creating and Updating records in Dataverse from SharePoint
    I'm getting the following error:


    It's not finding the column in my Dataverse named SharePoint_ID
  • nleuck_101 Profile Picture
    429 on at
    Creating and Updating records in Dataverse from SharePoint
    I solved my previous error but now I'm getting this error when I update a record. Any ideas?



  • nleuck_101 Profile Picture
    429 on at
    Creating and Updating records in Dataverse from SharePoint
    Nevermind I solved that issue as well. This part in your example was failing for me.

  • Ninjasabi Profile Picture
    122 on at
    Creating and Updating records in Dataverse from SharePoint
    Glad you came right! Nicely done 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard