Forum Discussion
Error message : Expression.Error
- 9 months ago
The result I got without the error message I obtained by editing the _ValidateAge function. I pointed out the problem with what you sent me in a previous message. However, the result is not correct as none of the emails were properly validated. You will have to correct that.
The _ValidateAge method that I used is was to just check the ages to ensure that they are a integer.
(data as nullable text) as logical => let isValid = (try Int64.From(data))[HasError]=false in isValidBut you are going to have to edit your _ValidateEmail function as it is returning an incorrect result
This line is incorrect:
Source = RunDataQualityCheck(MyTestTable, "MyTestTable", DataQualityActionTable)
DataQualityActionTable is the name of the variable. You need to replace that with the name of the appropriate table.
- Mederic9 months ago
Post Patron
Hello ronrsnfld ,
Thank you for looking into the issue.
I applied the same arguments as in the screenshot below, but it is not working.
I do not see what I need to change in the function.Best regards,
- ronrsnfld9 months ago
Super User
Examining the lesson more closely, it seems there are multiple errors.
The cause of your specific error is in the _ValidateAge function. You copied it verbatim from the lesson as
(data as nullable text) as logical => let isValid = if [YourValidationRuleHere] then true else false in isValidContrary to the instructions, you did not replace [YourValidationRule] with a functioning validation rule, hence the error which propagates to your result.
Please note that the lesson suggests with regard to the Validation Functions: "You can easily debug your M code by adding a custom column to your original table." Had you done that, you would have found the error when you checked that validation rule.
You should do that anyway to ensure the rules function as you wish.
On the good side, it seems that the RunDataQualityCheck code does seem to work properly, so once you get the actual rules sorted, you should be OK.
Good learning experience!
- Mederic9 months ago
Post Patron
Thank you ronrsnfld ,
Indeed, I had overlooked that part, and thank you for your feedback.
However, I find it unfortunate that to obtain the final result, we still need to add a column to the initial table.And why does this step not simply appear in the statement !!
I will try to understand all this.
Thank you.
Best regards.
- ronrsnfld9 months ago
Super User
I was incorrect. The problem is deeper into the function. I will look at it more closely.