Thep Excel

Table.ViewErrorสร้าง View Error

สร้าง Error สำหรับ Table.View Handlers

fx
=Table.ViewError(error) as any

ความนิยม2/10
ความยาก7/10
ประโยชน์3/10

อัปเดต 6 December 2025

Syntax & Arguments

อาร์กิวเมนต์ ชนิด คำอธิบาย
error record Record ที่ระบุรายละเอียดของ Error (เช่น Reason, Message)

ฟังก์ชัน Table.ViewError ใช้สำหรับโยน (Raise) Error ในบริบทของการทำงานของ Table.View โดยเฉพาะ เพื่อแจ้งให้ M Engine ทราบว่าเกิดข้อผิดพลาดที่ระดับ View Handlers

How it works

Custom Connector Error Handling

Custom Connector Error Handling

Examples

สร้าง Error แบบง่ายTable.ViewError([Reason = "CustomError", Message = "Something went wrong"])

สร้าง Error record เพื่อส่งกลับไปยัง Engine

fx
=Table.ViewError([Reason = "CustomError", Message = "Something went wrong"])

ผลลัพธ์Error Record
ใช้ใน OnInvoke Handlerlet View = Table.View(null, [ GetRows = () => …, OnInvoke = (function, args) => if function = "RestrictedFunction" then Table.ViewError([Reason = "AccessDenie…

ตัวอย่างการใช้ Table.ViewError เพื่อปฏิเสธการเรียกใช้ฟังก์ชันบางอย่างใน Custom Connector

fx
let
View = Table.View(null, [
GetRows = () => …,
OnInvoke = (function, args) =>
if function = "RestrictedFunction" then
Table.ViewError([Reason = "AccessDenied", Message = "Function not allowed"])
else
…
])
in
View

ผลลัพธ์Table View or Error
Error พร้อม DetailTable.ViewError([ Reason = "Expression.Error", Message = "Column not found", Detail = "Column ID does not exist" ])

สร้าง Error ที่ระบุรายละเอียดเพิ่มเติมเพื่อช่วยในการ Debug

fx
=Table.ViewError([
Reason = "Expression.Error",
Message = "Column not found",
Detail = "Column ID does not exist"
])

ผลลัพธ์Error with Detail

Resources & Related

ฟังก์ชันที่ผู้เขียนโยงไว้กับ Table.ViewError จัดกลุ่มตามหมวด · ชี้ที่ชื่อใดชื่อหนึ่ง แล้วฟังก์ชันที่ใช้คู่กันจะมีจุดทอง

ฟังก์ชันนี้Table.ViewErrorTable functions
Table functions (1)
Table.View

สร้างหรือแก้ไขพฤติกรรมของตาราง สำหรับการพัฒนา Custom Connector และการจัดการ Query Folding

Comments

อีเมลของคุณจะไม่ถูกเผยแพร่