So I am not too sure where to even start with this one. I have an app where i would like to have a form that you could fill in all the details about 10/11 fields which goes into a sharepoint list. One field is customer, i currently have a combo box in there so we can select more than one but currently it just concatenates this so the customer shows "Customer 1, Customer 2, Customer 3" ideally what i would like is for when submitting this form it would create 3 seperate rows in the list with all the information the same but just with one customer name in each. So then afterwards we can put in individual stats that relate to just that partner.
For example:
Current view:
Computer screen | 12/08/19 | Colette | Customer 1, Customer 2, Customer 3
What i would like:
Computer screen | 12/08/19 | Colette | Customer 1
Computer screen | 12/08/19 | Colette | Customer 2
Computer screen | 12/08/19 | Colette | Customer 3
Hopefully that makes sense any ideas?
Solved! Go to Solution.
Hi @Coletteb425 ,
I think you could create a collection that is the same as table2 and then update with the data of the collection.
For example:
ClearCollect(test,
RenameColumns(
AddColumns(Combo box1.SelectedItems,
"column1","Computer screen","column2","12/08/19","column3","Colette"
), //create a collection that is same as the table that you want
"Value",
"customer" //the value of combo box's fieldname is Value by default, change it to its fieldname in the list
);
Collect(listname,test) //update the list with the data of the collection
You could be able to loop through the selected customers using ForAll and use Patch() to create a new record for each customer.
Since I don't know all the details of the Form and the fields/input controls used, I can't give you a great example but in general it would like something like this:
ForAll(Customer.SelectedItems, Patch(SPList, Defaults(SPList), {Customer:Results , Title:InputControls, ......}))
Hi @Coletteb425 ,
I think you could create a collection that is the same as table2 and then update with the data of the collection.
For example:
ClearCollect(test,
RenameColumns(
AddColumns(Combo box1.SelectedItems,
"column1","Computer screen","column2","12/08/19","column3","Colette"
), //create a collection that is same as the table that you want
"Value",
"customer" //the value of combo box's fieldname is Value by default, change it to its fieldname in the list
);
Collect(listname,test) //update the list with the data of the collection
I am having a very similar problem, I need to use patch() to create multiple list items in one click but, I want one column to be unique in each record. This value will be selected out of the combobox. The current issue is getting the patch to write unique values.
Below is an oversimple example
Date: Today()
Name: TextInput.Text
ForAll(ComboBox_Tasks.SelectedItems,Patch('SPList',Defaults('SPList'), {'Name': Name_Input_1.Text},{'Evaluator': Evaluator_Input_Txt_1.Text},{'Qualification Date':Date_Completed_4.SelectedDate},{'Expiration Date': DateAdd(Date_Completed_4.SelectedDate,3,Years)}, {'Task Name': ???
How would I have it fill for each selected item in the combo box?
@Jeff_Thorpe
So I managed to do this in the end @Haze you are basically there you just need the one that is repeated to bring back the result so I assume task name is the one you are selecting in ComboBox so you just need to put either result in or name of the data source that the combobox is pulling from.
I have a form where I want a new record for each person with all other data matching. Where would I write the patch?
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
184 | |
53 | |
50 | |
37 | |
36 |
User | Count |
---|---|
274 | |
91 | |
86 | |
76 | |
75 |