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
Boricuanet
Frequent Visitor

Validate data when importing file

Hello dear community,

 

I have the following problem and also query.

How can I validate the data before extracting the data, check the file(source) contains information. To avoid errors(attached image).
For example: validate if report.html has data. If NO data, create a table with two columns, one row with zero values.

(I know that the error is due to not finding the "Computer" column and it will never exist when there is no data in the html file).

Boricuanet_0-1654893893967.png

 

 

 

let
    Origen = Web.Contents("https://site.com/report.html"),
    #"Tabla extraída a partir de HTML" = Html.Table(Origen, {{"Column1", "TABLE:nth-child(91) > * > TR > :nth-child(1)"}, {"Column2", "TABLE:nth-child(91) > * > TR > :nth-child(2)"}, {"Column3", "TABLE:nth-child(91) > * > TR > :nth-child(3)"}, {"Column4", "TABLE:nth-child(91) > * > TR > :nth-child(4)"}}, [RowSelector="TABLE:nth-child(91) > * > TR"]),
    #"Encabezados promovidos" = Table.PromoteHeaders(#"Tabla extraída a partir de HTML", [PromoteAllScalars=true]),
    #"Tipo cambiado" = Table.TransformColumnTypes(#"Encabezados promovidos",{{"Computer", type text}, {"Number", Int64.Type}, {"%", Int64.Type}, {"", type text}}),
    #"Columnas quitadas" = Table.RemoveColumns(#"Tipo cambiado",{""}),
    #"Tipo cambiado1" = Table.TransformColumnTypes(#"Columnas quitadas",{{"Number", Int64.Type}})
in
    #"Tipo cambiado1"

 

 

 

 

 

 


Appreciated Any guidance

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

MissingField.Ignore might be able to help with that.  It will bypass the error instead of stopping on it.  Here is a video showcasing the feature.

https://www.youtube.com/watch?v=D59nkSr_JqQ&ab_channel=Goodly

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

MissingField.Ignore might be able to help with that.  It will bypass the error instead of stopping on it.  Here is a video showcasing the feature.

https://www.youtube.com/watch?v=D59nkSr_JqQ&ab_channel=Goodly

 

Hi jdbuchanan71

Thanks for the link. It will help me to orient myself.

Best regards

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.