Search code examples
powerappspowerapps-canvaspowerapps-collectionpowerapps-selected-items

Create the dynamic controls in powerapps


Based on the drop down the respective dropdown of type choices should change and if we click the addrow it has to increment the number of rows . I am new to powerapps and to achive this how to have the same list when we click the add row button.Should I use gallery for this.


Solution

  • Use the PowerFX Collect() function here.

    1. OnSelect of the "Add Row" button:
    Collect(colRecords,
        {
            id: CountRows(colRecords) + 1,
            join: chkJoin.Selected.Value,
            andOr: chkAndOr.Selected.Value,
            type: ddType.Selected.Value,
            operators: ddOperators.Selected.Value,
            valueResult: ddValue.Selected.Value
        }
    )
    

    Where all the values on the left side of the colons above are the names of your columns and the values on the right side are the names of your controls.

    1. Ensure the Gallery Items property is set to colRecords