Canvas App – Quick Reference


Recently we were working on Canvas Apps so thought of listing down some of the key points for quick reference

  • Use Items property for defining values for Drop Down and Combo Box.

Items = [“Branch”,”Country”]


  • Use DefaultSelectedItems for Setting Default values for Combo Box.

DefaultSelectedItems = [“Branch”]

  • To disable multiple selections for Combo Box set SelectMutiple as false

SelectMultiple = false


  • Change Data Source of Gallery based on Combo Box selected value

Items = If(ComboBox1.Selected.Value = “Branch”, Branches, Countries)


  • Filter Gallery’s data based on Text Box (string search)

Items = If(ComboBox1.Selected.Value = “Branch”,Filter(Branches,searchInput.Text in cre9d_value ||searchInput.Text in cre9d_name), Filter(Countries,searchInput.Text in cre9d_value ||searchInput.Text in cre9d_name))

Filter à

Search à

  • Unlock the Data Card field within the form to make changes to its properties

  • Use Navigate to move to a different Screen on OnSelect of Button

Navigate(Screen2, ScreenTransition.Fade)

  • The first item of the Gallery acts as a template

  • Use TemplateFill property to highlight the selected item in the Gallery.

TemplateFill = If(ThisItem.IsSelected,RGBA(233,150,150,10))

  • Use Sort to sort the Data Source for Items property

Items = Sort(Requests,’Created On’,Descending)

  • Fetch User’s Security Role and hide and show control based on it.

If(LookUp([@’Security Roles’], Name = “Maker”, Role) in Concat(LookUp([@Users], ‘Primary Email’ = User().Email).’Security Roles (systemuserroles_association)’, Role & “;”), true, false)

  • Submit, Reset, and New Form on saving a record on OnSelect of Button

SubmitForm(frmRequest);

ResetForm(frmRequest);

NewForm(frmRequest);

  • DataField is the most important property of the DataCard, which binds the control to the field in the Data Source.

The default value of the DataCard.

  • ThisItem is how we interact with the current record.

  • On SubmitForm – the form control reads the value of DataField property of all the cards to find the field to change and the value of each card from the Update property.

  • Clear Button and Enable Spell Check option for Text Input

checks for the spelling as well provide the option to clear the text box as shown below.

Update / Set a Contextual Variable (referenced on the screen where they are created) 

UpdateContext({varCount: 1, varActive: true, varName: User().FullName})

Set a global variable (available across the app

Set(varCount, 1);Set(varActive, true);Set(varName, User().FullName)

  • With UpdateContext we can declare more than one variable at a time, which is not possible with global variable.
  • Use GUID function à

To generate a new GUID use  GUID()

To convert a string to GUID(“0f8fad5b-d9cb-469f-a165-70867728950e”)

  • To set a variable null – Set(myNullVar, Blank())
  • GroupBy  function – returns a table with records grouped together based on the values in one or more columns.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-groupby

GroupByTableColumnName1 [, ColumnName2, … ], GroupColumnName )

  • ForAll function – to evaluate a formula against all records of a Table

ForAll(TableFormula)

  • Table – Required. Table to be acted upon.
  • Formula – Required. The formula to evaluate for all records of the Table.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-forall

  • Component – Reusable control

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/create-component

  • Pass parameter 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-param#param

  • Patch gives more control than SubmitForm

https://sharepains.com/2020/06/19/patch-vs-submitform-vs-update-power-apps/

  • Delegable data sources – Dataverse, SharePoint, SQL Server

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

https://docs.microsoft.com/en-us/connectors/commondataservice/#power-apps-delegable-functions-and-operations-for-dataverse

  • Get the response from Power Automate

  • App OnStart Property

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/object-app#onstart-property

  • Using Excel as Static Data for the app.

http://powerappsguide.com/blog/post/code-how-to-define-a-read-only-table-of-static-data

  • Connection.Connected (Offline) – to check if app is connected to network or not.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/signals#connection

  • Concurrent Function to evaluate multiple formulas at the same time.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-concurrent

  • IfError for Error handling

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-iferror#iferror

  • AppChecker – for checking the canvas app for accessibility.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/accessibility-checker

Hope it helps ..

Advertisements

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

3 thoughts on “Canvas App – Quick Reference”

Please share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.