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

Using 2 Sharepoint lists to save & submit

I created an app that our field workers use to submit daily reports. The app is setup to save the inputted data into a SharePoint list.

 

"When an item is created or modified" to the list, a PowerAutomate (flow) with a 3rd party add-on takes the data from the list and automatically creates a PDF and emails it to the office. 

 

My problem is that I need to implement a save option so that the report does not all have to be filled out at once. 

 

My idea is to use a second list for saving the data, and then once the report is ready to be submitted the data will be added from the save list to the primary list - so the PDF is created and sent.

 

However, I am not sure if this is possible/how this could be implemented?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Using 2 Sharepoint lists to save & submit

Hi @randywade ,

 

Having 2 lists would be hard to maintain and could makes things complicated.

 

An alternative solution would be to use 1 list but have a Status column. In your Power App, the app would set status to "In Progress" or something when the user clicks Save.  You would also need a "Submit" button which then does a final save to the list and updates the Status to "Submitted".  Have your Flow still trigger on "When an item is created or modified" but have a condition action after the trigger to check that the Status is submitted.  Only run the rest of the Flow if the record is submitted.

 

 

View solution in original post

7 REPLIES 7
Highlighted
Super User
Super User

Re: Using 2 Sharepoint lists to save & submit

Hi @randywade ,

 

Please, follow these steps:

1- Create a field called "List" with type text and the default value is "First".

2- Duplicate your list, with the same fields/columns and structure

3- Change the field called "List" to default value "Second"

 

3- In your app, the list items, use in the property Items similar with the code:

Search your FirstList and get items

Set your results into the new collection called ListItems

Search your Secondlist and get items

Append your results into the existing collection called ListItems

 

4- On the save button in your form, create a validation:

If(DataCardValue12.Text = "First", SubmitForm(yourForm), If(IsEmpty(DataCardValue13.Value), Patch(SecondList, Defaults(SecondList), yourForm.Updates), Patch(SecondList, First(Filter(SecondList, ID = DataCardValue13.Value)), yourForm.Updates))

*DataCardValue12 is your field that contains the "List" field value, you can add in the form and set like visible false.

*DataCardValue13 is your field that contains the "ID" field value

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Renato Romão
https://www.linkedin.com/in/renatoromao/

 


Did I answer your question? Mark my post as a solution!
Thanks!

Renato Romão,

Power Virtual Agents course (+1.000 students): https://www.udemy.com/pva-beginners
Highlighted

Re: Using 2 Sharepoint lists to save & submit

Hi @randywade ,

 

Having 2 lists would be hard to maintain and could makes things complicated.

 

An alternative solution would be to use 1 list but have a Status column. In your Power App, the app would set status to "In Progress" or something when the user clicks Save.  You would also need a "Submit" button which then does a final save to the list and updates the Status to "Submitted".  Have your Flow still trigger on "When an item is created or modified" but have a condition action after the trigger to check that the Status is submitted.  Only run the rest of the Flow if the record is submitted.

 

 

View solution in original post

Highlighted
Advocate I
Advocate I

Re: Using 2 Sharepoint lists to save & submit

Am I creating the field called "list" in the SharePoint list, or in the app?

Highlighted
Advocate I
Advocate I

Re: Using 2 Sharepoint lists to save & submit

This would be a much simpler solution. I am going to give this a try.

Highlighted
Super User
Super User

Re: Using 2 Sharepoint lists to save & submit

On the list @randywade .


Did I answer your question? Mark my post as a solution!
Thanks!

Renato Romão,

Power Virtual Agents course (+1.000 students): https://www.udemy.com/pva-beginners
Highlighted
Advocate I
Advocate I

Re: Using 2 Sharepoint lists to save & submit

After further consideration I think the solution provided by @HSheild makes more sense for my app (especially because I am a beginner).

 

Do either of you have a recommendation on how I can append the text to the "status" column based on which button is pressed?

Highlighted

Re: Using 2 Sharepoint lists to save & submit

Hi @randywade 

 

To update the Status column. I have done something similar before.  My Status column in SharePoint is a choices column.

 

I assume that you have a Edit Form in your app which points to the SharePoint list.  Basically, what you can do is get the Submit button to update a variable to the Submitted status value and then set that variable as the Default value for the Status datacard on your edit form.  The Submit button also submits the Edit Form to then update the SharePoint list

 

The formulas look something like this:

 

For the Submit button OnSelect.  In my example I am setting the status to a value of "Order Entered" instead of "Submitted"

UpdateContext({recordStatus:LookUp(Choices('Email Order Manager'.Status),Value ="Order Entered")});SubmitForm(EditForm1)

 

On the Status datacard, you set Default to something like

If(IsBlank(recordStatus),ThisItem.Status,recordStatus)

  

Helpful resources

Announcements
secondImage

New Return to Workplace

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

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (6,235)