cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

How to save data in a sharepoint list based on the user selection?

Hello,

I'm new to Power App and trying to build my first App. 

The requirement is the user needs to fill out a form to request some information. 

I have a sharepoint list collecting the basic information about the user and understanding the request. This part was easy. I created a form in Power app and collected the information in the sharepoint list.

Another sharepoint list has rows of data elements the user is requesting. Basically we expose a list to the user and the user can select what information it needs. For this I created a gallery, which expose the information to the user. Screenshot attached. 

PoojaG_0-1596559558859.png

The checkbox gives user the functionality to chose the data. Now here the complication begins. Once the user selects this data using the checkbox, All the selected options should be saved in a separate SharePoint list along with the master id from the form, so we know who needs/selected what data. Is this achievable? Please guide. thank you!!!

20 REPLIES 20
Highlighted

@krishnags  it kinda works. But as you mentioned, it retrieves only the first record selected 😞 

Highlighted
Responsive Resident
Responsive Resident

@PoojaG great! at least it worked right. Need to know the fields in 3rd SharePoint List and Collection. So that the Patch can be composed in such a way that it accommodates all the selected requirements

Highlighted

@krishnags , Below is the screenshot of the field in the Collection. The records are the records selected by the user

PoojaG_0-1596576155777.png

Below screenshot is of the third sharepoint list where the data is getting stored from the collection

PoojaG_1-1596576288437.png

Hope that helps. I really appreciate your time for helping me resolve this. 

 

Highlighted
Responsive Resident
Responsive Resident

@PoojaG please try this

Patch('User Data Element', Defaults('User Data Element'),{'Unique ID':from3.LastSubmit.ID},{'Data Element':Concat(colSelectedReq,email,",")})

Eg: Address Line 4, Address postal code

This creates the record in 3rd SP List, with the selected requirements from the gallery as comma separated.

View solution in original post

Highlighted

@krishnags  thanks Krishna for helping me throughout. I will accept this as solution for now. Would have love to get the data in each row, and for that will keep exploring. This was extremely helpful and I learned a lot along the way. Thank you sooooo much!!!

Highlighted
Responsive Resident
Responsive Resident

@PoojaG I thought the other way... go with this

 

ForAll(colSelectedReq(Patch('User Data Element', Defaults('User Data Element'),{'Unique ID':from3.LastSubmit.ID},{'Data Element': 'Data Elements'}))

Highlighted

@krishnags  that didn't work. Attaching the screenshot. 

PoojaG_0-1596582427948.png

 

 

Highlighted
Responsive Resident
Responsive Resident

try this once...

ForAll(colSelectedReq(Patch('User Data Element', Defaults('User Data Element'),{'Unique ID':from3.LastSubmit.ID},{'Data Element':Text( 'Data Elements')}))

 

Highlighted

@krishnags thanks for checking, but that doesn't work either. What I notice is, there is an extra close bracket missing for the ForAll function and perhaps there needs to be another parameter.

 

PoojaG_0-1596587429975.png

 

Highlighted
Responsive Resident
Responsive Resident

there was an issue with that snippet, try this

ForAll(colSelectedReq,Patch('User Data Element', Defaults('User Data Element'),{'Unique ID':from3.LastSubmit.ID},{'Data Element':Text( 'Data Elements')}))

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,132)