cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Connecting a NewForm to another NewForm

I have three tables:

 

Employees - EmployeeProjects - Projects

Where each record in EmployeeProjects has a ProjectID, EmployeeID, and has an explanation of the employee's role on the project.

 

I am trying to do the following:

1) Have one new form, "NewProject," that creates a new project, with ProjectID autonumber, title, and other information (easy)

2) Submit NewProject and direct to another new form, "EmployeesOnProject" (easy)

3) EmployeesOnProject creates records in EmployeeProjects using the ProjectID from NewProject

 

I have no idea how to accomplish the third step. I've been doing similar steps where a user would select a Project from a list, and the ProjectID would populate using ProjectList.Selected.ID. Is there a way for the second new form to automatically use the ProjectID created in the first new form?

 

Thanks for everyone's help in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Connecting a NewForm to another NewForm

Edit forms have a LastSubmit property. This property will give you the last record created. You can get the project id from that. For instance:

Form1.LastSubmit.ProjectID

Just replace Form1 with the name of your form.

 

Some other form properties that you may be interested in are OnSuccess and OnFailure. For instance, you could only navigate to the next form in OnSuccess.

 

Here's a link that explains these properties and more, which you may find useful if you want to know more: 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-form-detail

 

Hope this helps!

- Paul C.
Software Engineer on PowerApps

View solution in original post

4 REPLIES 4
Highlighted
Helper II
Helper II

Re: Connecting a NewForm to another NewForm

Since the ProjectID is an autonumber field, I assume it is simply incrementing? In that case, the current project has the highest number in the ProjectID column. You can reference this value using:

Max(NewProjectTable,ProjectID)

Depending on what you're trying to do, you may need to:

Text(Max(NewProjectTable,ProjectID))

 

Highlighted
Microsoft
Microsoft

Re: Connecting a NewForm to another NewForm

Edit forms have a LastSubmit property. This property will give you the last record created. You can get the project id from that. For instance:

Form1.LastSubmit.ProjectID

Just replace Form1 with the name of your form.

 

Some other form properties that you may be interested in are OnSuccess and OnFailure. For instance, you could only navigate to the next form in OnSuccess.

 

Here's a link that explains these properties and more, which you may find useful if you want to know more: 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-form-detail

 

Hope this helps!

- Paul C.
Software Engineer on PowerApps

View solution in original post

Highlighted
Helper II
Helper II

Re: Connecting a NewForm to another NewForm

That's great! I hadn't seen that before. So, to submit a record and navigate to a new screen I would have an icon/button with an OnSelect property to SubmitForm and then the form's OnSuccess property would be set to Navigate(otherscreen,none) ?

Highlighted
Microsoft
Microsoft

Re: Connecting a NewForm to another NewForm

Yes, exactly!

- Paul C.
Software Engineer on PowerApps

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

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

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

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

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