cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Patching multiple labels text to different rows

Hello,

 

I'm building a project tracker app and i'm having some difficulty building my patch function. This is what the app looks like:

2020-10-23_11h55_52.png

 

 The commodity field is a combobox with the option of multiple selections. There are 12 text inputs bellow that may be displayed according to the intitial and final date you set on the date pickers. 

 

What i need to do is store the commodity and month/value information in different rows. For example: if 2 commodities are selected ("A" and "B") and the user inputs the values as shown in the image, the output should be the table bellow:

 

Project Name...CommodityDateValue
Project A...AOct 20201000
Project A...ANov 20202000
Project A...ADec 20203000
Project A...BOct 20201000
Project A...BNov 20202000
Project A...BDec 20203000

 

I've managed to use ForAll to upload the different commodities but im struggling to find i way to do the rest. I tought about a possible solution repeating the formula 12 times, one for each textinput, and patching again if the textinput is visible but that wouldn't be to pratical. Do you think there is a simpler way of doing that?

 

This is what i have so far:

 

 

 

 

 

ForAll(
    COMM_INPUT.SelectedItems;
    Patch(
        HOPPER;
        Defaults(HOPPER);
        {
            Título:Project_ID.Text;
            Project_Name: PROJECT_INPUT.Text;
            Region: REGION_INPUT.SelectedText.Result;
            Country:COUNTRY_INPUT.SelectedText.Result;
            BG:BG_INPUT.SelectedText.Result;
            Division:DIVISION_INPUT.SelectedText.Result;
            Commodity:Result;
            SKU:SKU_INPUT.Text;
            Sales_District:SLS_DISTRICT_INPUT.SelectedText.Result;
            Cust_Code:CUST_INPUT.Text;
            Sales_Type:If(Checkbox1.Value=true;Checkbox1.Text;Checkbox2.Value=true;Checkbox2.Text;Checkbox3.Value=true;Checkbox3.Text);
            Date: INITIAL_DT_1.Text;
            'Value OP': 'Mes 1'.Text
        }
    )
) ;; 

If(
    'Mês 2'.Visible = true;
        ForAll(
            COMM_INPUT.SelectedItems;
            Patch(
                HOPPER;
                Defaults(HOPPER);
                {
                    Título:Project_ID.Text;
                    Project_Name: PROJECT_INPUT.Text;
                    Region: REGION_INPUT.SelectedText.Result;
                    Country:COUNTRY_INPUT.SelectedText.Result;
                    BG:BG_INPUT.SelectedText.Result;
                    Division:DIVISION_INPUT.SelectedText.Result;
                    Commodity:Result;
                    SKU:SKU_INPUT.Text;
                    Sales_District:SLS_DISTRICT_INPUT.SelectedText.Result;
                    Cust_Code:CUST_INPUT.Text;
                    Sales_Type:If(Checkbox1.Value=true;Checkbox1.Text;Checkbox2.Value=true;Checkbox2.Text;Checkbox3.Value=true;Checkbox3.Text);
                    Date: INITIAL_DT_2.Text;
                    'Value OP': 'Mês 2'.Text
                }
            )
        );
        false
)


        


        
    
    

 

 

 

 

 


 Thank You!

0 REPLIES 0

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (74,449)