0
votes

I am trying to build a Power App that creates Input text boxes dynamically.

This is my data.

Category Name         Product 1       Product 2     Product 3  Product 4 
Marketing Center 1     1               1              2           2
Marketing Center 2     1               1              2           2
Marketing Center 3     1               1              2           2
Marketing Center 4     1               1              2           2
Marketing Center 5     1               1              2           2

Now, the Problem here is My Category Names and as well as Product columns increases over time.

How Can I build a User Input table dynamically to get the User Inputs - Something like this...and gives me the total of it...

Category Name         Product 1       Product 2     Product 3  Product 4   Total 
Marketing Center 1     1               1              2           2         6
Marketing Center 2     1               1              2           2         6
Marketing Center 3     1               1              2           2         6
Marketing Center 4     1               1              2           2         6
Marketing Center 5     1               1              2           2         6

The values of the Products are editable and the total gets calculated on the fly as the user inputs.

I believe this can be done with some data modelling and collection concepts. But I am new to this.

1

1 Answers

1
votes

What is the Data Source? A SQL Table? A Sharepoint List? In-app data that user creates?

Somehow you need to get a Collection of the data (ex: colYourData). Once you have that, use the AddColumns and Sum functions to get the Total column.

Something like:

ClearCollect(colYourDataWithTotals, 
    AddColumns(colYourData,
        "Total",
        Sum(colYourData, product1, product2, product3, product4)
    )
)