cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Itsmesri
Level: Powered On

Can I save data like Master-Child relationship using SharePoint Lists with PowerApps?

I working on powerapp application to single sharepoint list. Now I need to add child sharepoint lists to existing sharepoint list and save data to Master list and child lists. Is it possible to do with PowerApps?

 

I have Project and Task SharePoint List as Master List and Mile Stone SharePoint List and Issues SharePoint List as child lists with Master List ID as look up field. 

 

powerapps.png

Now I want to save data if I save Master list and childlists same time and Read samething. Can some gurus explain how to works? Any video or documentation on this?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Can I save data like Master-Child relationship using SharePoint Lists with PowerApps?

Hi @Itsmesri,

What type of column in Sharepoint is ProjectID? If it is a Choice or Lookup type column you will need to use

Filter(Milestones, TemplateGalleryList1.Selected.ID=ProjectID.Id).  Lookup type columns are actually two column tables with a Value (the information shown) and an Id (Cap "I", Small "d").  Also, sharepoint will always give a delegation warning when you use Choice or Lookup type columns.  It can usually be ignored since these columns rarely exceed 2000 items.  However, to avoid it, create a collection like Collect(colMilestones,Milestones) and use colMilestones in your datatable as the datasource.  I would also uncheck the Allow Multiple values as this is likely to cause difficulties in the future.  

You should also be able to add a second datatable for issues on the same screen using the same filter.

View solution in original post

14 REPLIES 14
Super User
Super User

Re: Can I save data like Master-Child relationship using SharePoint Lists with PowerApps?

Hi @Itsmesri,

I'll take a shot at helping you get started.   Review @Meneghino's blog,  https://baizini-it.com/blog/index.php/2017/09/28/powerapps-101-create-your-own-forms/. Starting with a blank app, tablet layout, (Not Starting with data!).  It would be good if there was already data in your three lists as it is easier to visualize the process with data.  Add all three lists as datasource: ProjectTask, Milestones and Issues.  Using the datasource from Milestones follow @Meneghino 's example with two modifications:

  • Add a Dropdown control with the Items property set as ProjectTask and Value property (Right hand column, with dropdown control selected, halfway down the column is the Value dropdown. )  set to Title. This is how  you input the foreign key. 
  • Add two Datepicker controls for ProjectDate and CompletedDate.

Follow the numbered instructions to create a Screen with a Gallery and a custom Form with form controls.  At #29 (Save Icon), the Patch function would include ProjectTaskID: Dropdown1.Selected.ID (This will save your foreign key)

ProjectDate: Datepicker1.SelectedDate and CompletedDate: Datepicker2.SelectedDate. It should look something like this Set( SelectedId, Patch( Milestones, {ID: If( NewRecord, Blank(), SelectedId)}, {Title: TextInput1.Text, ProjectTaskID: Dropdown1.Selected.ID, ProjectDate:  Datepicker1.SelectedDate, CompletedDate: Datepicker2.SelectedDate}).ID ; UpdateContext({Editing:false, NewRecord:false}) 

You would follow the same steps for the Issues Screen and the ProjectTask screens. Let me know if you need more help with this.

Itsmesri
Level: Powered On

Re: Can I save data like Master-Child relationship using SharePoint Lists with PowerApps?

@Drrickryp I have already developed working app with Master list. Adding, edit and create. Now next steps for child list. Let me try your instructions.

Itsmesri
Level: Powered On

Re: Can I save data like Master-Child relationship using SharePoint Lists with PowerApps?

I am trying to dispay child table data based on Parent table ID using filter it is not working.

 

 

milestone.pngFilter I used like this 

Filter(Milestones,ProjectID.Id=CurrentItem.ID)

CurrentItem is a variable it declared in MainForm. 

 

How to filter Child list based on selected Parent ID?

 

Super User
Super User

Re: Can I save data like Master-Child relationship using SharePoint Lists with PowerApps?

@Itsmesri

In that case, this list would be used for a Dropdown or Combobox control on a form for submitting data to your Milestones and Issues lists.  (You would use the combobox instead of a dropdown if the number of items in the list was very large).  I would not worry about the issue of saving data simultaneously.  If you needed to add an item to your ProjectTask list, so that it was available to select in your other two lists, you would do that first by using the Gallery and Edit forms that you already have, then it would be available as a choice in your Dropdown. 

Super User
Super User

Re: Can I save data like Master-Child relationship using SharePoint Lists with PowerApps?

Hi @Itsmesri,

 

If there is a Gallery from where you selected this Form, it is that ID that you need to use in your formula. So the filter on the datatable should be: Filter(Milestones,ProjectID=Gallery1.Selected.ID).  You could also reference from the form if you had a label showing the ID.  In that case, you would filter the datatable with Filter(Milestones,ProjectID=Labelxx.Text).  You might have to wrap the Labelxx.Text as a Value(Labelxx.Text) to make it work.

Itsmesri
Level: Powered On

Re: Can I save data like Master-Child relationship using SharePoint Lists with PowerApps?

I have tried to filter as you said. Filter(Milestones,ProjectID=TemplateGalleryList1.Selected.ID) It is not filtering any data. 

And also I see warning on ProjectID in Items Property like this and at datatable as well.

 

Spoiler

Delegation warning. The highlighted part of this formula  might not work correctly with column "ProjectID" on large data sets. The data source might not be able to process the formula and might return an incomplete data set. Your application might not return correct results or behave correctly if the data set is incomplete.

 

Super User
Super User

Re: Can I save data like Master-Child relationship using SharePoint Lists with PowerApps?

Hi @Itsmesri,

What type of column in Sharepoint is ProjectID? If it is a Choice or Lookup type column you will need to use

Filter(Milestones, TemplateGalleryList1.Selected.ID=ProjectID.Id).  Lookup type columns are actually two column tables with a Value (the information shown) and an Id (Cap "I", Small "d").  Also, sharepoint will always give a delegation warning when you use Choice or Lookup type columns.  It can usually be ignored since these columns rarely exceed 2000 items.  However, to avoid it, create a collection like Collect(colMilestones,Milestones) and use colMilestones in your datatable as the datasource.  I would also uncheck the Allow Multiple values as this is likely to cause difficulties in the future.  

You should also be able to add a second datatable for issues on the same screen using the same filter.

View solution in original post

Itsmesri
Level: Powered On

Re: Can I save data like Master-Child relationship using SharePoint Lists with PowerApps?

milestone.png

PowerunAppy
Level: Powered On

Re: Can I save data like Master-Child relationship using SharePoint Lists with PowerApps?

FAO webmaster@powerusers.microsoft.com:

 

@Drrickryp: if you put all those smileys into your reply to liven up a wet October evening, I apologise to you & Microsoft.  Interesting reply, BTW

 

This article appears to have some text that is being converted into emojis

 

For example @Drrickryp's reply in https://powerusers.microsoft.com/t5/forums/postpage/board-id/PowerAppsIdeas was obfuscated with by the markup processing converting  ".D" to a grinning emoji e.g. 

 

ProjectTaskID.Dropdown1.Selected.ID // (I assume that this was the original poster's intention)

was converted to ProjectTaskIDSmiley Very Happyropdown1.Selected.ID

 

Could you please revise your markup language to eliminate such confusions?  I don't mind the odd intentional grinning or frowning emoji, but when your automatic markup system intrudes into a well-reasoned reply to an article, it takes something away from your users' communications.

 

Many thanks for your attention.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

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