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 III
Super User III

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 III
Super User III

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 III
Super User III

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 III
Super User III

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (9,554)