<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error Handling for API that returns empty dataset in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Error-Handling-for-API-that-returns-empty-dataset/m-p/1727885#M28426</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I attempt to refresh a dataset (Source[data]) that is empty and error is thrown:&lt;/P&gt;&lt;P&gt;Expression.Error: The column 'Column1' of the table wasn't found.&lt;BR /&gt;Details:&lt;BR /&gt;Column1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is M Query call to API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;HeaderKey = [Headers =[#"api-key"="xyz"]],&lt;BR /&gt;SourceUrl = "&lt;A href="https://myapi.com/api/v1/disabledtrain" target="_blank" rel="noopener"&gt;https://myapi.com/api/v1/disabledtrain&lt;/A&gt;",&lt;BR /&gt;Source = Json.Document(Web.Contents(SourceUrl,HeaderKey)),&lt;/P&gt;&lt;P&gt;Data = Source[data],&lt;BR /&gt;#"Converted to Table" = Table.FromList(Data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),&lt;BR /&gt;#"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "DisabledTrain"}}),&lt;BR /&gt;#"Expanded DisabledTrain" = Table.ExpandRecordColumn(#"Renamed Columns", "DisabledTrain", {"affected", "goId", "trainId", "connectingTrnId", "trainArriveTime", "connectingTrainDepartTime", "stationId", "majorLocCd", "updatedBy", "updatedDate"}, {"DisabledTrain.affected", "DisabledTrain.goId", "DisabledTrain.trainId", "DisabledTrain.connectingTrnId", "DisabledTrain.trainArriveTime", "DisabledTrain.connectingTrainDepartTime", "DisabledTrain.stationId", "DisabledTrain.majorLocCd", "DisabledTrain.updatedBy", "DisabledTrain.updatedDate"}),&lt;BR /&gt;#"Renamed Columns1" = Table.RenameColumns(#"Expanded DisabledTrain",{{"DisabledTrain.affected", "Affected"}, {"DisabledTrain.connectingTrainDepartTime", "Connect Depart Time"}, {"DisabledTrain.connectingTrnId", "Connecting Train"}, {"DisabledTrain.goId", "General Order"}, {"DisabledTrain.majorLocCd", "Major Location Code"}, {"DisabledTrain.stationId", "Station"}, {"DisabledTrain.trainArriveTime", "Train Arrive Time"}, {"DisabledTrain.updatedBy", "Updated By"}, {"DisabledTrain.updatedDate", "Updated Date"}, {"DisabledTrain.trainId", "Train"}})&lt;BR /&gt;in&lt;BR /&gt;#"Renamed Columns1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I handle this situation?&lt;/P&gt;</description>
    <pubDate>Wed, 17 Mar 2021 13:59:26 GMT</pubDate>
    <dc:creator>2013smt</dc:creator>
    <dc:date>2021-03-17T13:59:26Z</dc:date>
    <item>
      <title>Error Handling for API that returns empty dataset</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Error-Handling-for-API-that-returns-empty-dataset/m-p/1727885#M28426</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I attempt to refresh a dataset (Source[data]) that is empty and error is thrown:&lt;/P&gt;&lt;P&gt;Expression.Error: The column 'Column1' of the table wasn't found.&lt;BR /&gt;Details:&lt;BR /&gt;Column1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is M Query call to API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;HeaderKey = [Headers =[#"api-key"="xyz"]],&lt;BR /&gt;SourceUrl = "&lt;A href="https://myapi.com/api/v1/disabledtrain" target="_blank" rel="noopener"&gt;https://myapi.com/api/v1/disabledtrain&lt;/A&gt;",&lt;BR /&gt;Source = Json.Document(Web.Contents(SourceUrl,HeaderKey)),&lt;/P&gt;&lt;P&gt;Data = Source[data],&lt;BR /&gt;#"Converted to Table" = Table.FromList(Data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),&lt;BR /&gt;#"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "DisabledTrain"}}),&lt;BR /&gt;#"Expanded DisabledTrain" = Table.ExpandRecordColumn(#"Renamed Columns", "DisabledTrain", {"affected", "goId", "trainId", "connectingTrnId", "trainArriveTime", "connectingTrainDepartTime", "stationId", "majorLocCd", "updatedBy", "updatedDate"}, {"DisabledTrain.affected", "DisabledTrain.goId", "DisabledTrain.trainId", "DisabledTrain.connectingTrnId", "DisabledTrain.trainArriveTime", "DisabledTrain.connectingTrainDepartTime", "DisabledTrain.stationId", "DisabledTrain.majorLocCd", "DisabledTrain.updatedBy", "DisabledTrain.updatedDate"}),&lt;BR /&gt;#"Renamed Columns1" = Table.RenameColumns(#"Expanded DisabledTrain",{{"DisabledTrain.affected", "Affected"}, {"DisabledTrain.connectingTrainDepartTime", "Connect Depart Time"}, {"DisabledTrain.connectingTrnId", "Connecting Train"}, {"DisabledTrain.goId", "General Order"}, {"DisabledTrain.majorLocCd", "Major Location Code"}, {"DisabledTrain.stationId", "Station"}, {"DisabledTrain.trainArriveTime", "Train Arrive Time"}, {"DisabledTrain.updatedBy", "Updated By"}, {"DisabledTrain.updatedDate", "Updated Date"}, {"DisabledTrain.trainId", "Train"}})&lt;BR /&gt;in&lt;BR /&gt;#"Renamed Columns1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I handle this situation?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 13:59:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Error-Handling-for-API-that-returns-empty-dataset/m-p/1727885#M28426</guid>
      <dc:creator>2013smt</dc:creator>
      <dc:date>2021-03-17T13:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Error Handling for API that returns empty dataset</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Error-Handling-for-API-that-returns-empty-dataset/m-p/1731854#M28480</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="249558" data-lia-user-login="2013smt" class="lia-mention lia-mention-user"&gt;2013smt&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Could you please confirm that whether it exist the field named "&lt;STRONG&gt;Column1&lt;/STRONG&gt;" in your source? Please provide the related screenshot of source data in order to make troubleshooting. You can also refer the content in the following links to resolve your problem.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-query/dealing-with-errors#the-column-of-the-table-wasnt-found" target="_self"&gt;&lt;STRONG&gt;The column of the table wasn't found&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.antaresanalytics.net/post/2018/08/13/data-management-m-scripting-preventing-the-column-of-the-table-wasnt-found-error-messag" target="_self"&gt;&lt;STRONG&gt;Power Query: Preventing "The column of the table wasn't found" error&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 06:09:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Error-Handling-for-API-that-returns-empty-dataset/m-p/1731854#M28480</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-19T06:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error Handling for API that returns empty dataset</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Error-Handling-for-API-that-returns-empty-dataset/m-p/1759646#M28742</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="249558" data-lia-user-login="2013smt" class="lia-mention lia-mention-user"&gt;2013smt&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Whether your problem has been resolved?&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 09:58:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Error-Handling-for-API-that-returns-empty-dataset/m-p/1759646#M28742</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-01T09:58:40Z</dc:date>
    </item>
  </channel>
</rss>

