0

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.

user1877936
  • 351
  • 3
  • 7
  • 22

2 Answers2

1

Yes you can use a gallery for this and Patch a new item to the list every time you need to add a row (new item=new row) To create a new record: Patch('datasource',Defaults('datasource'),{...})

marianr99
  • 146
  • 5
1

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
SeaDude
  • 3,725
  • 6
  • 31
  • 68
  • Hi, how to delete added rows on click of remove icon. i have used the function RemoveIf(colRecords,id>ThisItem.id+1) and on start made it as visible false.but it didnt work. how to get the row count of that to show the remove icon only from second row and delte accordling. – user1877936 Jul 21 '21 at 16:38
  • `Remove(colRecords, ThisItem)` – SeaDude Jul 22 '21 at 02:54