1 / 35

Mastering Logic in PowerApps: Best Practices for Form Creation

Learn top-notch strategies in using logic to design and customize forms in PowerApps for optimal user experience and functionality.

mjohns
Download Presentation

Mastering Logic in PowerApps: Best Practices for Form Creation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Best Practices for using Logic in PowerApps Laura Rogers, Microsoft MVPIW Mentor – SharePoint & PowerApps Training Company BRK2282

  2. Agenda

  3. Controls and Properties

  4. Controls on the Insert Tab

  5. Changing Control Properties • PowerApps offers multiple interfaces for editing properties • Formula Bar • Tab Menu • Property Pane &Advanced Pane

  6. Form – The Control for User Input

  7. Form – The Control for User Input Visually design your form, with Cards for each field

  8. Creating Forms • Display modes: • Edit – used for both new forms and editing existing ones. • Display – view an existing item • Pick a data source, like a SharePoint list • Pick cards (Fields)

  9. DEMO: Creating a Form New customized SharePoint list form,New standalone app with a form

  10. Cards on a Form Label Input or Value Select data source Each data card can include a label and either a value or input field Choose number of columns and layout Select necessary fields and decide on format

  11. About Cards • Check boxes to add cards • Each card = a field • Drag to rearrange • Pick a layout & number of columns • Snap to columns – to auto arrange • Drag to adjust card widths • Advanced properties are “locked” by default

  12. Tree structure of controls. Screens = “Parent” Hierarchy of Controls Screen Form Card Controls in card

  13. Logic Concepts

  14. PowerApps Formulas • Whatever is typed in this box, is a formula • Formula = one or more functions • Semicolons in between functions • Select a parenthesis, to highlight the corresponding one, as seen here:

  15. Interact with a Form • To start using a form, a function must be used. Click a button to fill out a new form Click to edit an existing item Click to view an existing item

  16. Form Functions and Modes Form Modes Mode= Newbrand new form Mode= Editmodify existing form Mode= Viewread existing form • NewForm() • EditForm() • ViewForm() • SubmitForm() • ResetForm() These tell the form what its mode is

  17. But…Form modes are not the same thing as display modes

  18. New, Edit and View Modes Example form is called FrmEditCustomer

  19. Default display mode is inherited from the parent form. Unlock a card, to edit DisplayMode. Card Display Modes

  20. Display Modes Examples Edit NewForm & EditForm View (read only) ViewForm Disabled Edit View Disabled

  21. Conditions on Cards

  22. Card Display Mode Example Parent.DisplayMode= Edit Cards inherit parent. DisplayMode = Parent.DisplayMode

  23. Logic on Display Mode • Goal:Customer Status is read only for new forms. • IFMode = NewTHENDisplayMode.ViewOtherwiseDisplayMode.Edit

  24. Logic on Display Mode • Goal:Customer status is disabled if the current user is not a manager • IFCurrent user has no direct reportsTHENDisplayMode.DisabledOtherwiseDisplayMode.Edit

  25. Visibility – show and hide controls • Every control has a Visibility property. • Visibility is always a Boolean. true or false • Goal: The hours used field should only show if project status is complete.

  26. Reference a Field Value • There are several methods • Selected item in a galleryWon’t work on new items • Current item in a formWon’t work dynamically • Field value in a controlMost reliable & dynamic

  27. Validation Conditions • Card property is called Required • Required = Boolean (true or false) • Use an IF statement to set conditional required fields • If estimated cost is greater than $5,000, the manager field is required:

  28. DEMO Logic in forms

  29. Submitting a Form • Forms don’t come with a Submit button • Use anything: • Property: OnSelect • SubmitForm(NameOfFormControl) • Then what? Best Practice: OnSuccess property- set logic that happens after the form is submitted, such as navigating to another screen. • Common practices: • Navigate() • Back() • Set variable • Send email Button Shape Icon

  30. Gallery Basic Info Galleries: display a list of records • Can be horizontal or vertical • Select a layout or use blank layout Contextual: • The first row in the gallery, is the Template. It dictates the behavior of all subsequent rows

  31. Connecting Galleries to Forms • From a gallery or table list of items, create an edit button inside of the gallery item (template). • Edit the form and also navigate to the screen that the form is on. • EditForm(YourFormName);Navigate(ScreenName) • On the form itself: • Form property: Item • If editing or displaying an existing item, which item? • Example: The selected item in a gallery called galExpenseDetail

  32. DEMO Connect a form to a gallery

  33. Please evaluate this sessionYour feedback is important to us! Please evaluate this session through MyEvaluations on the mobile appor website. Download the app:https://aka.ms/ignite.mobileApp Go to the website: https://myignite.techcommunity.microsoft.com/evaluations

More Related