ๅใ็ฅใ้ใใPower AppsใซใจใฉใผใCatchใใๆฉ่ฝใฏใชใใฆใใจใฉใผใ็บ็ใใใจๅณUIใซใจใฉใผใกใใปใผใธใ่กจ็คบใใใฆใใใ
ไปๅใฏใใใชใจใฉใผ่กจ็คบใๆๅถใใใจใฉใผใ็บ็ใใๅ ดๅใฎๅฆ็ใ่จ่ฟฐใใ่ฉฆ้จๆฎต้ใฎๆฉ่ฝใIfError้ขๆฐใจIsError้ขๆฐใฎไฝฟใๆนใใกใขใ
โปในใฏใทใงใใในใฆใPresenceใใงใฏใชใใPresenseใใซใชใฃใฆใใพใใๆฐใซใใชใใงใใ ใใใ
ไฝฟ็จใใใตใณใใซใขใใช
ใใใจๅฝ็ถใจใฉใผใ็บ็ใใใฎใงใใใฎใจใฉใผใๆค็ฅใใๅฆ็ใ่ฒใ ่ฉฆใใฆใฟใใ
่จญๅฎ
ใจใฉใผ่กจ็คบใๅบใใชใใใใซใใใ ใใงใใใใฐใใใฎ่จญๅฎใใชใณใซใใใ ใใงใไธๅฟ้่กจ็คบใซใฏใงใใใ
IsError้ขๆฐ
ใพใใฏIsError้ขๆฐใใใฎIsError้ขๆฐใฏใใฎๅใฎ้ใใๅฆ็ใๅฎ่กใใใจใใซใจใฉใผใ็บ็ใใใ๏ผใ็ขบ่ชใใฆใใใๆฉ่ฝใ
ใใใชๆใใงIsError้ขๆฐใฏใใจใฉใผใ็บ็ใใๅฏ่ฝๆงใใใๅฆ็ใๅ ฅใใฆใใใใจใใจใฉใผใ็บ็ใใใจใใซtrueใใจใฉใผใ็บ็ใใชใใฃใใจใใซfalseใ่ฟใใฆใใใใ
IfError้ขๆฐ
ใใใใใใIsError้ขๆฐใซๅฏพใใIfError้ขๆฐใฏๅฐใใใใใซใใใ
IfError้ขๆฐใฎๅ ฌๅผใฎ่ชฌๆใฏ
IfError ้ขๆฐใฏใใจใฉใผใ่ฆใคใใใพใงๅคใใในใใใพใใ ้ขๆฐใใจใฉใผใๆคๅบใใๅ ดๅใ้ขๆฐใฏๅฏพๅฟใใ็ฝฎๆๅคใ่ฉไพกใใฆ่ฟใใใใไปฅ้ใฎใใใซ่ฉณใใ่ฉไพกใๅๆญขใใพใใ ใจใฉใผใ่ฆใคใใใชใๅ ดๅใฏใๆขๅฎๅคใๆๅฎใใใใจใใงใใพใใ
ใจใใใ
ใพใใๅ ฌๅผใซใใๆงๆใฏใใใชๆใใ
IfError( Value1, Replacement1 [, Value2, Replacement2, … [, DefaultResult ] ] )
- Value(s) โ ๅฟ ้ ใ ใจใฉใผๅคใใในใใใๆฐๅผใ
- Replacement(s) โ ๅฟ ้ ใ ่ฉไพกใใๆฐๅผใใใใณไธ่ดใใๅคใฎๅผๆฐใใจใฉใผใ่ฟใใๅ ดๅใซ่ฟใใใๅคใ
- DefaultResult โ ใชใใทใงใณใ ๆฐๅผใซใจใฉใผใ่ฆใคใใใชใใใฉใใใ่ฉไพกใใๆฐๅผใ
ใใใใฉใใใใใจใๅฐใใ ใๆใไธใใใ
ใจใฉใผใใในใใใๆฐๅผ1ใค ใใค ่ฆๅฎๅคใใชใๅ ดๅ
ใจใฉใผใใในใใใๆฐๅผใPresenceๅๅพๅฆ็ใงใใในใใใๆฐๅผใๅคฑๆใใใจใใซ่ฟใๅคใใPresenceใๅใใพใธใใๆๅญๅใ
ไปๅใฏPresenceๅๅพๅฆ็ใงnullใๆธกใใฆใใฆใ็ขบๅฎใซๅคฑๆใใใฎใงPresenceใๅใใพใธใใ่กจ็คบใใใใ
ใจใฉใผใใในใใใๆฐๅผใ1ใค ใใค ่ฆๅฎๅคใใใๅ ดๅ
่ฆๅฎๅคใๆๅฎใใใจใใในใใใๆฐๅผใๅ จ้จๆๅใใใจใใซIfError้ขๆฐใ่ฟใๅคใ่ฆๅฎๅคใซใชใใฎใงใPresenceๅๅพๅฆ็ใๆๅใใฆใใใฎPresenceๆ ๅ ฑใ่กจ็คบใใใใซใ่ฆๅฎๅค๏ผๆๅญๅใPresenceๆๅใใใใฉ่ฆๅฎๅคๅบใใพใฃใใ๏ผใ่กจ็คบใใใใ
ใจใฉใผใใในใใใๆฐๅผใ่คๆฐ ใใค ่ฆๅฎๅคใใชใๅ ดๅ
ใคใกใผใธใจใใฆใฏใ
IfError( ๅฆ็1,"Presenceใๅใใพใธใ", ๅฆ็2,"Presenceใๅใใพใธใใง")
ใใใฃใใพใงใฎPresenceใฉใใซใซๅ ฅใฃใฆใใๆใใ
ใใใใใจใใฉใใซใซ่กจ็คบใใใๅคใฏ
- ๅฆ็1ใๆๅใใคๅฆ็2ใๆๅโๅฆ็2ใฎ็ตๆ
- ๅฆ็1ใๅคฑๆโ”Presenceใๅใใพใธใ”๏ผๅฆ็2ใฏๅฎ่กใใใชใ๏ผ
- ๅฆ็1ใๆๅใใคๅฆ็2ใๅคฑๆโ”Presenceใๅใใพใธใใง”
ใจใชใใ
โปๅ จใใฟใผใณใซ็ปๅใ่ฒผใฃใฆใใใจ่จไบใ้ทใใชใฃใกใใใฎใง็็ฅใใใถใใใใชๆธใๆนใใชใใ๏ฝ
ใจใฉใผใใในใใใๆฐๅผใ่คๆฐ ใใค ่ฆๅฎๅคใใใๅ ดๅ
ใคใกใผใธใจใใฆใฏใ
IfError( ๅฆ็1,"Presenceใๅใใพใธใ", ๅฆ็2,"Presenceใๅใใพใธใใง", ใใ"่ฆๅฎๅคใใง" )
ใใใฃใใพใงใฎPresenceใฉใใซใซๅ ฅใฃใฆใใๆใใ
ใใใใใจใใฉใใซใซ่กจ็คบใใใๅคใฏ
- ๅฆ็1ใๆๅใใคๅฆ็2ใๆๅโ”่ฆๅฎๅคใใง”
- ๅฆ็1ใๅคฑๆโ”Presenceใๅใใพใธใ”๏ผๅฆ็2ใฏๅฎ่กใใใชใ๏ผ
- ๅฆ็1ใๆๅใใคๅฆ็2ใๅคฑๆโ”Presenceใๅใใพใธใใง”
ใจใชใใ
ใใใฏ่คๆฐใฎๅผใ่ฉไพกใใฆใๅ จ้จๆๅใใใจใใซใฉใใซใซๆๅใ่กจ็คบใใใใฟใใใชใจใใซไฝฟใใใใใใชใ
ๅไฝใฎๆฐๅผใจIfError้ขๆฐ
ๆๅพใซๅไฝใฎๆฐๅผใจIfError้ขๆฐใฎ็ตใฟๅใใใ
MSๅ ฌๅผใซใใไพใซใ
IfError( Patch( DS1, ... ), Notify( "problem in the first action" ); false, Patch( DS2, ... ), Notify( "problem in the second action" ); false, true )
ใจใใใฎใใใฃใฆใใใใใใฟใณใฎOnSelectใซๅ ฅใฃใฆใใๅ ดๅใฎๅไฝใ่ใใฆใฟใใ
Patchใ ใจใใใใซใใใฎใงใ
IfError( ๅฆ็1, Notify( "problem in the first action" ); false, ๅฆ็2, Notify( "problem in the second action" ); false, true )
ใจใใฆ่ชฌๆใใใ
ใใฎๅ ดๅใใใฟใณใๆผไธใใใจใ
- ๅฆ็1ๆๅใใคๅฆ็2ๆๅโtrueใ่ฟใใใ๏ผใคใพใUIไธใฏไฝใ่ตทใใชใ๏ผ
- ๅฆ็1ๅคฑๆโNotify( “problem in the first action” )ใๅฎ่กใใใfalseใ่ฟใใใ๏ผUIไธใฏใproblem in the first actionใใจใใ่ญฆๅใๅบใใ ใ
- ๅฆ็2ๅคฑๆโNotify( “problem in the second action” )ใๅฎ่กใใใfalseใ่ฟใใใ๏ผUIไธใฏใproblem in the second actionใใจใใ่ญฆๅใๅบใใ ใ
ใใใใซใใใฎใ ใใใฉใๅฆ็ใๅคฑๆใใใจใใฎๅไฝใจใใฆNotifyใจfalseใฎใชใฟใผใณใ่กใใใใคใกใผใธใ
ๅไฝใฏ่คๆฐๆๅฎๅฏ่ฝใชใฎใงใใใใชๆธใๆนใใงใใใ
IfError( ๅฆ็1, UpdateContext({str:"problem in the first actions"}); Notify( str ); false, ๅฆ็2, Notify( "problem in the second action" ); false, true )
ใใฎๅ ดๅใฏๅฆ็1ใๅคฑๆใใใจใใstrใจใใๅคๆฐใซใจใฉใผใกใใปใผใธใๆฎใใคใคใNotifyใซ่ญฆๅใๅบใใใจใใงใใใ
ใพใจใ
ๆๅพใฏๅฐใ้งใ่ถณใซใชใฃใกใใฃใใใฉใIfError้ขๆฐใจIsError้ขๆฐใฏใใใพใงIsBlankOrError้ขๆฐใใใชใใฃใPower Appsใซใๆ่ปใชใจใฉใผๅฆ็ใๅฎ่ฃ ใใใใจใใงใใใใใซใชใใ
ใใฒๆฉใใซๅ ฌ้ใใฆใปใใใชใใจๆใใพใใใจใใ
ใณใกใณใ