{"id":47,"date":"2021-08-08T09:31:01","date_gmt":"2021-08-08T01:31:01","guid":{"rendered":"https:\/\/pearsongang.com\/?p=47"},"modified":"2021-08-08T09:34:55","modified_gmt":"2021-08-08T01:34:55","slug":"power-apps-canvas-frustrating-error","status":"publish","type":"post","link":"https:\/\/pearsongang.com\/?p=47","title":{"rendered":"Power Apps &#8211; Canvas  &#8211; Frustrating Error"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pearsongang.com\/wp-content\/uploads\/2021\/08\/heart-facial-expression-free-content-emoji-smile.jpg?resize=247%2C152&#038;ssl=1\" alt=\"\" class=\"wp-image-48\" width=\"247\" height=\"152\" srcset=\"https:\/\/i0.wp.com\/pearsongang.com\/wp-content\/uploads\/2021\/08\/heart-facial-expression-free-content-emoji-smile.jpg?w=830&amp;ssl=1 830w, https:\/\/i0.wp.com\/pearsongang.com\/wp-content\/uploads\/2021\/08\/heart-facial-expression-free-content-emoji-smile.jpg?resize=300%2C185&amp;ssl=1 300w, https:\/\/i0.wp.com\/pearsongang.com\/wp-content\/uploads\/2021\/08\/heart-facial-expression-free-content-emoji-smile.jpg?resize=768%2C473&amp;ssl=1 768w\" sizes=\"auto, (max-width: 247px) 100vw, 247px\" \/><figcaption>Oh No!!<\/figcaption><\/figure><\/div>\n\n\n\n<p>The error message I am afraid to see when building a canvas app is:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"46\" src=\"https:\/\/i0.wp.com\/pearsongang.com\/wp-content\/uploads\/2021\/08\/image.png?resize=640%2C46&#038;ssl=1\" alt=\"\" class=\"wp-image-49\" srcset=\"https:\/\/i0.wp.com\/pearsongang.com\/wp-content\/uploads\/2021\/08\/image.png?w=910&amp;ssl=1 910w, https:\/\/i0.wp.com\/pearsongang.com\/wp-content\/uploads\/2021\/08\/image.png?resize=300%2C22&amp;ssl=1 300w, https:\/\/i0.wp.com\/pearsongang.com\/wp-content\/uploads\/2021\/08\/image.png?resize=768%2C56&amp;ssl=1 768w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>This is a particular bad error message to get. Especially, if you have been coding for a while without monitoring the errors that may have been introduced. Time to debug this message is not small. At end of this article I suggest a possible timesaver.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Coding without checking errors<\/strong><\/p>\n\n\n\n<p>Yes this does happen to me in particular. For example I know I have used a new variable, but the declaration will come on a different event. Thus this &#8216;known error&#8217; may mask any other errors you may introduce.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Brief Basic Background<\/strong><\/p>\n\n\n\n<p>Some basics about record types:<br><br>UpdateContext(<br>       { l_personSoccerRec:<br>          {<br>              soccerperson  : GUID(),<br>             firstName: &#8220;Joe&#8221;,<br>             lastName: &#8220;Bloggs&#8221;,<br>             favouriteTeam: &#8220;Chelsea&#8221;,<br>             mostExcitingPlayer: &#8220;Grealish&#8221;<br>         }<br>     }<br>);<\/p>\n\n\n\n<p>This data called be setup using individual variables:<br> <\/p>\n\n\n\n<p> UpdateContext( {l_soccerPerson: GUID()}); <br> UpdateContext( {l_firstName: &#8220;Joe&#8221;});<br> UpdateContext( {l_ lastName:  &#8220;Bloggs&#8221;}); <br> UpdateContext( {l_favouriteTeam: &#8220;Chelsea&#8221;});<br> UpdateContext( {l_ mostExcitingPlayer:  &#8220;Grealish&#8221;});  <br><br>By reading the data, it should be clear that the first sample code is far cleaner to read.<br>There are multiple articles, that will dig deeper into reasons.<\/p>\n\n\n\n<p><br> <strong>Retrieved from Table<\/strong> <\/p>\n\n\n\n<p><strong><br><\/strong>If retrieved from a table the record may be populated by<br> UpdateContext( { l_personSoccerRec: LookUp(SoccerPeople: soccerperson = [guid] )}) \/\/[guid] is pseudo syntax<br><br><\/p>\n\n\n\n<p><strong>Retrieved from Form<\/strong><\/p>\n\n\n\n<p> UpdateContext(<br>       { l_personSoccerRec:<br>          {<br>             soccerperson : GUID(txtFirstName.Text),   <br>             firstName: txtFirstName.Text,<br>             lastName: txtLastName.Text,<br>             favouriteTeam: txtFavouritTeam.Text,<br>             mostExcitingPlayer: txtExcitingPlayer.Text<br>         }<br>     }<br>); <\/p>\n\n\n\n<p><strong>Huge Assumption<\/strong><\/p>\n\n\n\n<p>The table does not reference other tables, so not normalised etc. Thus not optimally designed.<\/p>\n\n\n\n<p><br><br><strong>Introduce the Error<\/strong><\/p>\n\n\n\n<p><br>   UpdateContext(<br>       { l_personSoccerRec:<br>          {<br>             soccerperson :txtFirstName.Text,   <br>             firstName: txtFirstName.Text,<br>             lastName: txtLastName.Text,<br>             favouriteTeam: txtFavouritTeam.Text,<br>             mostExcitingPlayer: txtExcitingPlayer.Text<br>         }<br>     }<br>);   <br><br> <strong>Error Message is Cryptic<\/strong> <\/p>\n\n\n\n<p><br><span class=\"has-inline-color has-vivid-red-color\">Incompatible type. We cant evaluate your formula because &#8230;.<br><\/span><br>This is really not helpful. In this example there is only 5 fields, but there could be many more.<br><\/p>\n\n\n\n<p><strong>Please Microsoft<\/strong><\/p>\n\n\n\n<p>Please can you advise the fieldname, even if  the issue is on more than one field. One field at a time will be a huge improvement.<br><br><strong>Time Saver<\/strong><br><br>Let me say I save and also save to my computer lots. If this type of error has taken over 15 minutes (and it can easily). I reload from my last &#8220;Save&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The error message I am afraid to see when building a canvas app is: This is a particular bad error message to get. Especially, if you have been coding for a while without monitoring the errors that may have been introduced. Time to debug this message is not small. At end of this article I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","om_disable_all_campaigns":false,"WB4WB4WP_MODE":"","WB4WP_PAGE_SCRIPTS":"","WB4WP_PAGE_STYLES":"","WB4WP_PAGE_FONTS":"","WB4WP_PAGE_HEADER":"","WB4WP_PAGE_FOOTER":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12,13,11,1],"tags":[10],"class_list":["post-47","post","type-post","status-publish","format-standard","hentry","category-canvas-app","category-errors","category-power-apps","category-uncategorized","tag-power-apps"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pearsongang.com\/index.php?rest_route=\/wp\/v2\/posts\/47","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pearsongang.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pearsongang.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pearsongang.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pearsongang.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=47"}],"version-history":[{"count":3,"href":"https:\/\/pearsongang.com\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions"}],"predecessor-version":[{"id":52,"href":"https:\/\/pearsongang.com\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions\/52"}],"wp:attachment":[{"href":"https:\/\/pearsongang.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pearsongang.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pearsongang.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}