Video summary

Power Apps (Control de Stock) - Video 5

Main summary

Key takeaways

Technology

Tech concepts & what the video teaches (Power Apps: Stock/Product management)

1) Dynamic filtering in a product gallery

  • Uses the Filter() function in the Items property of a control (likely a gallery/list) to filter the Products table.
  • Filter() takes two parameters:
    1. the table/list to filter (e.g., Products)
    2. the condition to apply
  • Filtering is controlled by a radio-button selection, using its selected value to decide which field to filter by:
    • If selected value equals something like code → filter by code
    • Else options like:
      • filter by description
      • filter by category
  • Addresses a key behavior difference for text filtering:
    • Exact match filtering: the gallery only updates when the input equals the field exactly.
    • Progressive / “starts with” filtering: suggests using StartsWith() instead of strict equality for text fields.

2) Insert/Modify product view using an “operation” variable

  • Creates an “operation” variable (e.g., bar_operation) to store whether the user is doing:
    • insert
    • modify
  • Navigation to the insert/modify product screen is driven by this variable.
  • The insert/modify form dynamically changes text using Concatenate(bar_operation, " products").

3) Editing an existing product by storing the selected record

  • On the Product view (gallery), the gallery OnSelect saves the entire selected product record into a record-type variable (e.g., product_registration_reg).
  • In the insert/modify form:
    • Default values for inputs are populated by referencing fields from that record variable.
    • Using a record variable makes it easier to pull all columns (e.g., code, description, stock/quantity, prices, etc.).
  • Behavior:
    • Modify loads the currently selected record.
    • Insert uses blank/default values.

4) Special handling for the Category ComboBox (dependent list)

  • Recommended approach: populate the category combo box using ForAll(Category, ...)-style logic:
    • Loop through all Category records
    • Extract and store:
      • category ID
      • category description
  • ComboBox configuration:
    • Items: generated list from categories (ID + description)
    • Value field: category description (or concatenated fields)
    • Default:
      • varies based on bar_operation
      • Insert: uses current context / chosen default
      • Modify: sets default from the saved selected product’s category field
  • Why this differs from VAT:
    • Category depends on a related table/list, so it requires filtering/loading logic.

5) VAT ComboBox default logic (temporary/static choices)

  • VAT is treated as a fixed set (examples mentioned: 10, 5, 60, Exempt).
  • Because VAT values are essentially temporary/static, the video uses simpler Default logic:
    • If inserting → default a VAT option (e.g., 10%)
    • If modifying → default based on the selected product record’s VAT value

6) Confirm validation and saving to the Products table

  • Confirm button:
    • Validates required fields like code and description
    • If empty → shows an error using Notify() with type: error and a duration (e.g., 2000 ms)
  • Insert:
    • Uses Patch()-like insertion (e.g., Patch(Products, Defaults(Products), {...}))
    • Maps each form control to the corresponding Products table fields
    • Handles data types using Value() where needed (e.g., numeric fields like stock/cost)
  • Modify:
    • Similar, but updates an existing record by filtering with the selected product record ID.

7) Adding new Categories via a popup overlay (no navigation away)

  • Adds a popup UI (rectangle group) shown/hidden using a Boolean variable (e.g., ver categoría / view category).
  • Buttons:
    • Register Category (shows popup)
    • Popup Save / Cancel
  • Popup behavior:
    • Cancel sets the visibility variable to false
    • Clicking outside the popup (on the background rectangle) also hides it
    • Save validates that the category text is not blank using IsBlank()
    • Uses Notify() on validation failure
    • On success, saves only the category description to the Category table
    • Updates the UI so the new category appears in the ComboBox

8) View / read-only mode for a “View” action

  • Adds a “view” operation mode (e.g., bar_operation = viewing).
  • Uses the control property DisplayMode to switch inputs into view-only:
    • when in view mode: inputs are disabled from editing
    • confirm buttons may also be disabled accordingly

9) Delete confirmation dialog + record deletion

  • Implements a grouped delete confirmation popup (Yes/No).
  • Uses a Boolean variable (e.g., ver delete) to show/hide the delete dialog.
  • On delete confirmation:
    • Uses Remove() on the Products table
    • Filters to remove only the selected record by matching IDs (deletes where ID equals the selected product record’s ID)
  • Notes: after deletion, you need to reset the form (subtitles mention Reset logic).

Main speakers / sources

  • No clear named speaker is provided in the subtitles.
  • The content appears to be delivered by a single instructional presenter (Power Apps tutorial author).

Original video