cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Haze
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
timl
Super User III
Super User III

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

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. 

Haze
Frequent Visitor

@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?

timl
Super User III
Super User III

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}
        )
) 

 

Haze
Frequent Visitor

@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

timl
Super User III
Super User III

@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

Haze
Frequent Visitor

@timl ,

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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (99,369)