I would like to use a ListBox to collect a selection of items and then save them to a SharePoint List. I understand that I can use Concat to convert the selected items to Text to save them to the List.
If the User needs to edit the selected items in the future, is there a way to read the record from the table and then highlight the selected items in the ListBox control?
I'm not using Form Controls, simply using Patch to save the record to the SharePoint List.
I now need to be able to allow the User to edit the values.
Solved! Go to Solution.
@irinak thank you for getting back to me. I found the answer to using Collect to post to a Datasource in this link
Basically this Code works:
Collect(temp,{},{},{}); Collect(datasource,temp)
Thanks again for your help with this.
Hi UB400,
ListBox supports setting a single default value. Gallery control with checkboxes may work better here.
Here is a simple example (without a SharePoint connection)
The above will add and remove Favorites from the collection. I am attaching a screenshot of what it would look like - you can customize it to fit your app.
Hope this works for you!
Irina
Thanks @irinak that is very hepfull.
I referred to the documentation for Collect, to try and understad what the syntax would be to "Collect" to the DataSource (in this case Sharepoint).
I tried Collect(Name of SPList,ThisItem)
While this did not show any errors in the formula, it does not add the record to the SP list, please advise?
Also I have some additional fields that I want to add to the record in SP. Looking at the Collect Documentation, I should be able to us the following syntax
Collect(SPList,{FirstName:TextBox1,Email:User()Email,Option:CheckBox1.???})
What should be the correct syntax to pass other values from the Screen together with the Text associated with the checkbox?
Thanks.
Hi UB400,
What does your SP list look like?
You may want to use a Form control if you are looking to update a record. To see form control in action, try creating an app directly from your SharePoint list. To do that, choose New -> Start with your data -> SharePoint. That will generate an app with 3 screens that will let you view, add and edit items. Here is a reference for the form control: https://powerapps.microsoft.com/en-us/tutorials/control-form-detail/
To answer the last question, you can use Checkbox1.Text to get the text or CheckBox1.Value to get the value of the checkbox
Best regards,
Irina
@irinak thank you for getting back to me. I found the answer to using Collect to post to a Datasource in this link
Basically this Code works:
Collect(temp,{},{},{}); Collect(datasource,temp)
Thanks again for your help with this.
User | Count |
---|---|
136 | |
133 | |
78 | |
72 | |
69 |
User | Count |
---|---|
222 | |
136 | |
78 | |
60 | |
54 |