cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marney
Helper II
Helper II

Help please with retrieving/storing from SP Choices List

Hello all!

Please may I ask for some help...

Building an app that our employees will use to identify their skills that should store their selections in a SP List against their name (ideally all skills in one column).

The users should be able to come back to the app and see the selections they have made and either add new ones or remove existing selection.

 

1) Have a sharepoint list with a list of 50 entries (skills)

2) Have a 2nd SP list that stores the results of Submit (have also created a Choice column in this list with all the entries in SP List 1 but not using it at the mo)

2) Have a gallery with Items property set to the list name (works fine, all items in the list are showing) and Collection created when clicking the arrow next to each item

3) Have a 2nd Gallery connected to the Collection so that when an item in Gallery 1 is selected, it populates in the 2nd Gallery.

 

I would like that Onselect of the submit button, the values selected in Gallery 2 are written back to a single column against the user that made the submission.

 

I have this in OnSelect: 
ForAll(Gallery2_1.AllItems, Patch(' Capability Inventory', Defaults('Capability Inventory'), Form4.Updates, {Choices:Label8_1.Text}))

 

Form4 in the formula is a form on the home screen that grabs logged in user name, their email, Line Manager etc.

 

The current result is that mutilple items are created in the SP list (one line in SP per each entry in Gallery 2) against the user that submitted it.

Have added some screenshots that will explain it.

Thank you in advance for any advice you can give me 🙂

 

SP List showing selected items in Gallery 2 after Patch...one entry for each item submitted bu the logged in userSP List showing selected items in Gallery 2 after Patch...one entry for each item submitted bu the logged in userSelected items FROM gallery 1 INTO Gallery2Selected items FROM gallery 1 INTO Gallery2Entries created in SP List; one for each item in Gallery 2 against the name of the user that submittedEntries created in SP List; one for each item in Gallery 2 against the name of the user that submitted

5 REPLIES 5
CNT
Super User
Super User

@marney The following formula will save one record per submission with the skills saved as a comma separated list.

Patch(' Capability Inventory', Defaults('Capability Inventory'), Form4.Updates, {Choices:Concat(Gallery2_1.AllItems, Label8_1.Text, ", ")})
marney
Helper II
Helper II

Thank you so much mate, that worked perfectly however I realise that capturing the skills in this way wont allow us to go back to the app, select a skill (in a gallery) and see who has selected that skill...and thats really the point of the app to 1) Capture the skills against all employees and 2) provide us with the functionality to highlight a skill and see who has it.

 

Once again, any advice would be massively appreciated!

@marney Create a LookUp Column with Allow Multiple Values. This way you can store multiple Skills for an Employee in a single record and also retrieve it however you want.

 

CNT_0-1623666990777.png

 

marney
Helper II
Helper II

Thank you my friend! Would I then update the code to:

 

Patch(' Capability Inventory', Defaults('Capability Inventory'), Form4.Updates, {'EMPLOYEE SKILLS':Concat(Gallery2_1.AllItems, Label8_1.Text, ", ")})

 

?

Thanks again

@marney Nope! Do this (replace yourSkillsComboBox with the actual name),

 

Patch('Capability Inventory', Defaults('Capability Inventory'), Form4.Updates, {'Employee Skills': yourSkillsComboBox.SelectedItems})

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,721)