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

Creating several new records in a sharepoint list for all of the options selected in a field

Hi all,

 

Hoping someone can help with this one. 

 

We have a scenario where users wish to raise change requests for reports that the business uses. There are approx 200 reports. A change can be requested that affects one or many of these reports. There may be only one change, or several changes that need to be made to one or many of these reports. Each change request is stored on a SharePoint list called 'MI_Change_Requests'.

 

For each change request, the jobs are broken down into 'Features'. We want to store these features on a separate SharePoint list called, imaginatively, 'Features'.

 

So as an example, a user may raise a change request that says I want 3 changes made to 4 reports. What we want to do is store the change request in the MI_Change_Request SharePoint list, but for the 3 changes that are needed, we want to store these as features against each report name, on the Features list. So, for each of the report names that are selected in the change request, we want a new entry in the 'Features' SharePoint list created.

 

We need the report names to be stored as text in SharePoint so that we can use search and filtering in Powerapps, so we have created a list in SharePoint called 'DD_Options' and listed all of the report names and ID's in there, then created a combobox in powerapps that points to a collection of that list for the report names. Essentially what we want to do is for every report name selected from that combobox, when the screen is saved, we want a new line created in the Features list to be populated with whatever data we want to put into it from the initial Change Request.

 

Does anyone have any ideas on how I can achieve this please? I've heard the FORALL command may help, but I can't work it out. 

 

Thanks in advance.

 

Jason.

 

 

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Creating several new records in a sharepoint list for all of the options selected in a field

Hi @jbirkenhead ,

 

Can you add some schematic diagrams to describe your needs intuitively 

I'm not sure if my understanding is right, but  I think you just need to use Patch function to create a new record, when the report name is selected and Feature data is entered, click patch to store data and report name into the Feature list.

Maybe I misunderstood your requirement, please explain it more.

Best regards,

Sik

 

 

Highlighted
Advocate I
Advocate I

Re: Creating several new records in a sharepoint list for all of the options selected in a field

Hi Sik,

 

Thanks for taking a look at this. I have added a basic diagram of what I am trying to do. At first I just want to get the data submitted to the correct sharepoint lists as text. Once the data is submitted, I will build a features screen within my app which will display the data submitted to the features list. 

 

When the data is submitted to the features sharepoint list, I will need a change ID from the change request stored against the feature so I can link it all up in the app. A problem with that I can see already is that for a new change request, the change ID does not exist yet until the data has been submitted to the sharepoint list. 

 

Thanks again,

 

Jason.

Highlighted
Community Support
Community Support

Re: Creating several new records in a sharepoint list for all of the options selected in a field

Hi @jbirkenhead ,

 

My understanding :

the combo box of report name can select multiple values, you want to create multiple rows with each report name in feature list ,  i.e. you select 3 report names in combobox , you want 'change request list' generate 1 row contains CR.ID, at meanwhile, you want the Feature list generate 3 rows contain the same CR.ID, but different report name, right?

If my understanding is right, you can refer to: 

 

ForAll(ComboBox1.SelectedItems,Patch('SP list',Defaults('SP list'),{CRID:CRID_Textinput.Text,'Report Name':TheReportName}))

 

Note: TheReportName is the column of DD_Options

Best regards,

Sik

 

Highlighted
Advocate I
Advocate I

Re: Creating several new records in a sharepoint list for all of the options selected in a field

Hi Sik,

 

I got several different errors for this, depending on how I tried to tweak the code as it didn't work as it was written.

 

Are you able to show me how you would have gone about setting this up please?

 

Thanks,

 

Jason.

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,899)