<?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 Re: Help with Error when applying schema when API returns null records in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Help-with-Error-when-applying-schema-when-API-returns-null/m-p/3411513#M44224</link>
    <description>&lt;P&gt;This appears to be similar to this previous unanswered post from a few years ago:&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Power-Query/Error-with-nullable-record-type-when-using-Table-ChangeType/m-p/940504#M32453" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Power-Query/Error-with-nullable-record-type-when-using-Table-ChangeType/m-p/940504#M32453&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Sep 2023 19:30:14 GMT</pubDate>
    <dc:creator>JoeFields</dc:creator>
    <dc:date>2023-09-01T19:30:14Z</dc:date>
    <item>
      <title>Help with Error when applying schema when API returns null records</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Help-with-Error-when-applying-schema-when-API-returns-null/m-p/3411508#M44223</link>
      <description>&lt;P&gt;I am getting errors on Record type objects when I try to apply a schema in my custom connector even though I have added the nullable type identifier in the schema.&lt;/P&gt;&lt;P&gt;The below example shows whenever I have location = null, it throws an error.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here is a condensed listing of how I am defining my schema in my PQ file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ProjectType = type table [
...
    location = nullable LocationType,
...],
    LocationType = type [
        country = text,
        state = text,
        streetName = text,
        streetNumber = text,
        suite = text,
        city = text,
        zip = text,
        complete = text,
        coords = nullable CoordsType
    ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have defined location as being a nullable record.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I copied the Table.ChangeType helper function from here:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/power-query/helper-functions#tablechangetype" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/power-query/helper-functions#tablechangetype&lt;/A&gt;. I also have been following the TripPin examples to build out my connector.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I change the schema definition to nullable any then it works but then I do not have my schema applied for the location records that are provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ProjectType = type table [
...
    location = nullable any,
...],&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The REST API I am connecting to sometimes has the location records filled in but sometimes location is just null as in the below examples:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't figure out where in the Table.ChangeType helper function I can make a tweak to cover the null record conditions but I would have thought making it nullable would have done the trick. Any thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 21:15:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Help-with-Error-when-applying-schema-when-API-returns-null/m-p/3411508#M44223</guid>
      <dc:creator>JoeFields</dc:creator>
      <dc:date>2023-10-02T21:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Error when applying schema when API returns null records</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Help-with-Error-when-applying-schema-when-API-returns-null/m-p/3411513#M44224</link>
      <description>&lt;P&gt;This appears to be similar to this previous unanswered post from a few years ago:&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Power-Query/Error-with-nullable-record-type-when-using-Table-ChangeType/m-p/940504#M32453" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Power-Query/Error-with-nullable-record-type-when-using-Table-ChangeType/m-p/940504#M32453&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 19:30:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Help-with-Error-when-applying-schema-when-API-returns-null/m-p/3411513#M44224</guid>
      <dc:creator>JoeFields</dc:creator>
      <dc:date>2023-09-01T19:30:14Z</dc:date>
    </item>
  </channel>
</rss>

