cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Patching New List Items with Unique Column

I have a SharePoint list in which I will create multiple new items with multiple same columns except one.

Date // Name // Task // Evaluator

 'Date':Date_Completed_4.SelectedDate}// 'Name': Name_Input_1.Text // Task // Evaluator': Evaluator_Input_Txt_1.Text 

This is in a ForAll loop as follows

ForAll(ComboBox_Tasks.SelectedItems,Patch('SPList' , Defaults('SPList') , {'Name': Name_Input_1.Text},{'Evaluator': Evaluator_Input_Txt_1.Text},{'Date':Date_Completed_4.SelectedDate}, 

This creates 90% of it but I now need the Task Name to be pulled from the combobox and change for each list entry.

"SP List"

Today() // Haze // Task 1 // Evaluator
Today() // Haze // Task 2 // Evaluator
Today() // Haze // Task 3 // Evaluator

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Patching New List Items with Unique Column

@Haze 

So what's the column name and data type of your task column in 'SPList'? If it's just a text column called Task, the code you would use is this.

ForAll(ComboBox_Tasks.SelectedItems,
       Patch('SPList' , 
              Defaults('SPList') , 
             {'Task': TaskName},
             {'Name': Name_Input_1.Text},  
             {'Evaluator': Evaluator_Input_Txt_1.Text},
             {'Date':Date_Completed_4.SelectedDate}
        )
) 

View solution in original post

6 REPLIES 6
Highlighted
Super User
Super User

Re: Patching New List Items with Unique Column

Hi @Haze 

Assuming that TaskName is the name of the display column that you use in your combo box, you can just refer to TaskName in your patch function like so:

ForAll(ComboBox_Tasks.SelectedItems,
       Patch('SPList' , 
              Defaults('SPList') , 
             {'Name': Name_Input_1.Text},
             {'Evaluator': TaskName},
              {'Date':Date_Completed_4.SelectedDate}
        )
) 

If you're not sure, I would add a label onto your form and type First(Combobox_Tasks.SelectedItems). into the Text property. The IntelliSense in the formula bar should tell you the correct property name to enter after the final dot. 

Highlighted
Frequent Visitor

Re: Patching New List Items with Unique Column

@timl ,

Thanks for responding!

Why is Evaluator tied to the Task Name? I cleaned up my OP to make more sense. The combobox_Tasks.SelectedItems is what I want to use as the changing variable per line.

 If Task 1, Task 2, and Task 3 are selected I want the final list to look like

Date // Name // Task 1 // Evaluator
Date // Name // Task 2 // Evaluator
Date // Name // Task 3 // Evaluator

All other inputs are fixed and patch() handles that well but currently I can only get it to repeat the task name not have it different for each record.

I was thinking maybe patch to create then patch to modify?

Highlighted
Super User
Super User

Re: Patching New List Items with Unique Column

Apologies @Haze 

This is what I was meant to say...

ForAll(ComboBox_Tasks.SelectedItems,
       Patch('SPList' , 
              Defaults('SPList') , 
             {'Name': TaskName},
             {'Evaluator': Evaluator_Input_Txt_1.Text},
             {'Date':Date_Completed_4.SelectedDate}
        )
) 

 

Highlighted
Frequent Visitor

Re: Patching New List Items with Unique Column

@timl ,

Name is tied to a text input box, not the task name. The task is its own category.

In this example when I press "Update Date of Qualifications" button I want to create 3 list entries.

5/14/20 // Name // Task 213 ... // Evaluator
5/14/20 // Name // Task 217 ... // Evaluator
5/14/20 // Name // CCT710 ...  // Evaluator

Highlighted
Super User
Super User

Re: Patching New List Items with Unique Column

@Haze 

So what's the column name and data type of your task column in 'SPList'? If it's just a text column called Task, the code you would use is this.

ForAll(ComboBox_Tasks.SelectedItems,
       Patch('SPList' , 
              Defaults('SPList') , 
             {'Task': TaskName},
             {'Name': Name_Input_1.Text},  
             {'Evaluator': Evaluator_Input_Txt_1.Text},
             {'Date':Date_Completed_4.SelectedDate}
        )
) 

View solution in original post

Highlighted
Frequent Visitor

Re: Patching New List Items with Unique Column

@timl ,

Thanks a bunch! I dont know why I didn't do that.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,041)