{"id":1100,"date":"2024-09-11T18:02:00","date_gmt":"2024-09-11T23:02:00","guid":{"rendered":"https:\/\/automatethemundane.com\/index.php\/2024\/09\/11\/dataflows-walkthrough\/"},"modified":"2024-09-11T18:02:00","modified_gmt":"2024-09-11T23:02:00","slug":"dataflows-walkthrough","status":"publish","type":"post","link":"https:\/\/automatethemundane.com\/index.php\/2024\/09\/11\/dataflows-walkthrough\/","title":{"rendered":"Dataflows walkthrough"},"content":{"rendered":"\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Dataflows are a powerful tool for importing large amounts of data from numerous data sources into Dataverse. Being such a powerful tool, certain steps need to be followed to ensure things like lookups and datatypes are handled correctly. The process I use is a very conservative approach as I like to ensure data is correct throughout the process. This guide will be broken down into three parts.<\/p>\n\n\n<h1 class=\"wp-block-heading\">Creating Dataverse table from Single CSV<\/h1>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Creating a Dataverse table from a csv is a method that can be used, though not one I would use on a frequent basis. I would have the csv file saved in a SharePoint Library to showcase how to manage a file that is stored there. <\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">The CSV I would have 20 rows with some random strings and int in it. <\/p>\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>String<\/th><th>Int<\/th><\/tr><\/thead><tbody><tr><td>CHAR-UQO<\/td><td>866<\/td><\/tr><tr><td>CHAR-GAA<\/td><td>370<\/td><\/tr><tr><td>CHAR-HRE<\/td><td>498<\/td><\/tr><tr><td>CHAR-EKF<\/td><td>432<\/td><\/tr><tr><td>CHAR-VFZ<\/td><td>386<\/td><\/tr><tr><td>CHAR-EIF<\/td><td>612<\/td><\/tr><tr><td>CHAR-ZZS<\/td><td>189<\/td><\/tr><tr><td>CHAR-USD<\/td><td>486<\/td><\/tr><tr><td>CHAR-CDZ<\/td><td>335<\/td><\/tr><tr><td>CHAR-TVZ<\/td><td>525<\/td><\/tr><tr><td>CHAR-RRT<\/td><td>595<\/td><\/tr><tr><td>CHAR-MVT<\/td><td>364<\/td><\/tr><tr><td>CHAR-OLY<\/td><td>717<\/td><\/tr><tr><td>CHAR-UKM<\/td><td>220<\/td><\/tr><tr><td>CHAR-UKP<\/td><td>962<\/td><\/tr><tr><td>CHAR-NEQ<\/td><td>535<\/td><\/tr><tr><td>CHAR-IZA<\/td><td>488<\/td><\/tr><tr><td>CHAR-BTU<\/td><td>582<\/td><\/tr><tr><td>CHAR-DUT<\/td><td>638<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Step one would be to go into the maker portal and create a New Datflow called New Table from CSV<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Then select SharePoint folder<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-1-1024x536.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Enter in the URL for the site and Authentication Type to Organizational account and then Sign in<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-2.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Once the connection is made, press Next.<\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">A list of all the items in the SP library selected will be displayed. The one I want is called Examplecsv1.csv. Select Transform to bring in all the data. \n<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-3-1024x536.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Once in Power Query Select Binary from the csv you want to load. <\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-4.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Power Query will then do its best to transform the data into the correct types. Lucky for me Power Query got it all correct. But if it did not, I could massage it as needed. All I have to do is select Next. <\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-5-1024x443.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Now I can select Load to new table, set the table name, and build out the columns. With all of it set, hit Next and Publish. \n<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-6-1024x532.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">My data is now loaded as expected.<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-7.png\" alt=\"\"\/><\/figure>\n\n\n<h1 class=\"wp-block-heading\">Loading from single CSV to Single Table<\/h1>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">The single csv will load to a table called My Table 1 it will have 2 columns, String Colum, and Int Column<\/p>\n\n\n<pre class=\"wp-block-code\"><code>erDiagram\n    My_Table\n    My_Table{\n        string String_Column PK\n        int Int_Column\n    }\n    <\/code><\/pre>\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-8.png\" alt=\"\"\/><\/figure>\n\n<\/div>\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-9.png\" alt=\"\"\/><\/figure>\n\n<\/div>\n\n<\/div>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">In the Power Apps Maker studio, I have created a new Dataflow called \u201cSingle CSV to Single Table\u201d<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-10.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">To make this example simple, I am just going to manually upload the csv into the dataflow<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-11.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Power Query will now launch giving me a view of the data\n<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-12.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">As an exercise, I will click on Transform Table, but because it all loaded correctly I really do not need to. <\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">I again see that the data has been brought in correctly and does not require transformations<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-13-1024x533.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">I have mapped the columns from the csv to the Dataverse table<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-14-1024x537.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">All I need to do now is select Next and Publish<\/p>\n\n\n<h1 class=\"wp-block-heading\">Loading data into multiple related Dataverse from multiple related csv files<\/h1>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">The csv data is as follows\n<\/p>\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\"><strong>Parent table<\/strong><\/p>\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>String<\/td><td>Int<\/td><\/tr><tr><td>STRING-1<\/td><td>642<\/td><\/tr><tr><td>STRING-2<\/td><td>893<\/td><\/tr><tr><td>STRING-3<\/td><td>600<\/td><\/tr><tr><td>STRING-4<\/td><td>515<\/td><\/tr><tr><td>STRING-5<\/td><td>774<\/td><\/tr><tr><td>STRING-6<\/td><td>442<\/td><\/tr><tr><td>STRING-7<\/td><td>546<\/td><\/tr><tr><td>STRING-8<\/td><td>619<\/td><\/tr><tr><td>STRING-9<\/td><td>522<\/td><\/tr><tr><td>STRING-10<\/td><td>256<\/td><\/tr><tr><td>STRING-11<\/td><td>662<\/td><\/tr><tr><td>STRING-12<\/td><td>384<\/td><\/tr><tr><td>STRING-13<\/td><td>952<\/td><\/tr><tr><td>STRING-14<\/td><td>736<\/td><\/tr><tr><td>STRING-15<\/td><td>244<\/td><\/tr><tr><td>STRING-16<\/td><td>146<\/td><\/tr><tr><td>STRING-17<\/td><td>942<\/td><\/tr><tr><td>STRING-18<\/td><td>462<\/td><\/tr><tr><td>STRING-19<\/td><td>956<\/td><\/tr><tr><td>STRING-20<\/td><td>381<\/td><\/tr><\/tbody><\/table><\/figure>\n\n<\/div>\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\"><strong>Child table<\/strong><\/p>\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>String<\/td><td>Int<\/td><td>Lookup<\/td><\/tr><tr><td>SECOND-1<\/td><td>560<\/td><td>STRING-1<\/td><\/tr><tr><td>SECOND-2<\/td><td>134<\/td><td>STRING-13<\/td><\/tr><tr><td>SECOND-3<\/td><td>448<\/td><td>STRING-17<\/td><\/tr><tr><td>SECOND-4<\/td><td>770<\/td><td>STRING-15<\/td><\/tr><tr><td>SECOND-5<\/td><td>833<\/td><td>STRING-6<\/td><\/tr><tr><td>SECOND-6<\/td><td>894<\/td><td>STRING-6<\/td><\/tr><tr><td>SECOND-7<\/td><td>294<\/td><td>STRING-2<\/td><\/tr><tr><td>SECOND-8<\/td><td>563<\/td><td>STRING-8<\/td><\/tr><tr><td>SECOND-9<\/td><td>889<\/td><td>STRING-9<\/td><\/tr><tr><td>SECOND-10<\/td><td>299<\/td><td>STRING-2<\/td><\/tr><tr><td>SECOND-11<\/td><td>582<\/td><td>STRING-11<\/td><\/tr><tr><td>SECOND-12<\/td><td>484<\/td><td>STRING-3<\/td><\/tr><tr><td>SECOND-13<\/td><td>373<\/td><td>STRING-19<\/td><\/tr><tr><td>SECOND-14<\/td><td>442<\/td><td>STRING-19<\/td><\/tr><tr><td>SECOND-15<\/td><td>951<\/td><td>STRING-4<\/td><\/tr><tr><td>SECOND-16<\/td><td>731<\/td><td>STRING-10<\/td><\/tr><tr><td>SECOND-17<\/td><td>391<\/td><td>STRING-16<\/td><\/tr><tr><td>SECOND-18<\/td><td>658<\/td><td>STRING-18<\/td><\/tr><tr><td>SECOND-19<\/td><td>336<\/td><td>STRING-9<\/td><\/tr><tr><td>SECOND-20<\/td><td>713<\/td><td>STRING-16<\/td><\/tr><\/tbody><\/table><\/figure>\n\n<\/div>\n\n<\/div>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">The first step is to create the two Dataverse tables. They will be called Parent and Child tables. In the Child table, I have created a lookup to the child table called \u201cParent Lookup\u201d<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-15.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">In the Parent table, I have created a key called Parent using the primary name. This will ensure that the data load works for the lookup column<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-16.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Then, I have loaded the data into the Parent table using the same process as above. Once all that data is loaded, I will create a new dataflow called Child Data flow and upload the csv<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-17-1024x536.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">With the data loaded, I will then import in the parent table from Dataverse. Select Get data, then Dataverse. Use the login controls to make a connection to Dataverse and bring in the Parent table<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-18-1024x506.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">With both datasets loaded, I need to update some security settings, select Options, Privacy and allow combining of data.<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-19-1024x537.png\" alt=\"\"\/><\/figure>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-20.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Now select Merge queries as new to join the two tables<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-21-1024x132.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Match the child table with the parent table based on the primary name<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-22.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Select the expand columns then select the primary name of the parent table (name for this example).<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-23.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">With the merge created, set the other two queries to do not load. Then Select Next<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-24.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Map the columns to the appropriate one, ensuring that the expanded column above goes to the primary name field of the parent column. Select Publish and watch the data be loaded. <\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-25-1024x521.png\" alt=\"\"\/><\/figure>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">We can now compare the new table with the source data and verify that it all looks as expected. <\/p>\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-26.png\" alt=\"\"\/><\/figure>\n\n<\/div>\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/image-27.png\" alt=\"\"\/><\/figure>\n\n<\/div>\n\n<\/div>\n\n\n<p class=\"has-background\" style=\"background-color: rgb(241, 241, 239)\">&#x1f4a1; The parent child tables COULD all be done in one dataflow, but I do not prefer it. I like to ensure my data is going in as expected in chucks<\/p>\n\n\n<p class=\"has-text-color\" style=\"color: rgb(0, 0, 0)\">Dataflows are a great tool and with a little planning you can make sure that data gets to the correct place and in the correct format.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Dataflows are a powerful tool for importing large amounts of data from numerous data sources into Dataverse. Being such a powerful tool, certain steps need to be followed to ensure things like lookups and datatypes are handled correctly. The process I use is a very conservative approach as I like to ensure data is correct [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1101,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48,22],"tags":[],"class_list":["post-1100","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dataflows","category-dataverse","entry","has-media"],"jetpack_featured_media_url":"https:\/\/automatethemundane.com\/wp-content\/uploads\/2024\/09\/photo-1518837695005-2083093ee35b-scaled.jpg","_links":{"self":[{"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/posts\/1100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/comments?post=1100"}],"version-history":[{"count":0,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/posts\/1100\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/media\/1101"}],"wp:attachment":[{"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/media?parent=1100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/categories?post=1100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/automatethemundane.com\/index.php\/wp-json\/wp\/v2\/tags?post=1100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}