Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Ben-Dev
Helper II
Helper II

Ignored Type Claims for Uri.Type, Guid.Type

Hello,

 

When using Table.Schema to view details for numeric columns that are Int64.Type or Currency.Type, the type claim that the column is "Int64.Type" or "Currency.Type" shows up in Table.Schema's column TypeName (good!).

 

However, for columns of Guid.Type and Uri.Type, Table.Schema's TypeName column simply shows Text.Type. How would I go about seeing that these columns claim to be Guid.Type and Uri.Type, respectively? I'd expect this info to be displayed in Schema's TypeName column, like it is for the numeric columns, but it isn't.

 

Example:

let
    Data = #table(type table [IntColumn=Int64.Type, CurrencyColumn=Currency.Type, GuidColumn=Guid.Type, UriColumn=Uri.Type], {})
in
    Table.Schema(Data)

 

Outputs:

TypeClaimsExample.png

 

Notice how the columns with the numeric "subtype" claims (Int64.Type and Currency.Type) display this claim in column TypeName while the two columns with text "subtype" claims (Guid.Type and Uri.Type) don't have this claim displayed in column TypeName.

 

Thank you!

1 ACCEPTED SOLUTION
artemus
Employee
Employee

You can use Type.TableColumn(Value.Type(table), "ColumnName") to get the type of a column and test if it is equal to Guid.Type, Uri.Type, or Password.Type

View solution in original post

4 REPLIES 4
artemus
Employee
Employee

You can use Type.TableColumn(Value.Type(table), "ColumnName") to get the type of a column and test if it is equal to Guid.Type, Uri.Type, or Password.Type

Thanks, @artemus.

 

Any chance Table.Schema could be updated to handle this consistently?

Unfortunatly, any changes here risk breaking backwards compadibility. Here is a function that adds the Type column to the schema:

 

(tbl) => Table.Join(Table.Schema(tbl), "Name", Table.ExpandRecordColumn(Value.ReplaceType(Record.ToTable(Type.RecordFields(Type.TableRow(Value.Type(tbl)))), type table [Name=text,Value=[Optional=logical, Type=type]]), "Value", {"Type"}), "Name", JoinKind.Inner)

 

Thanks, @artemus.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors