Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Dynamic Form with multiple SQL tables



I'm trying to create a rather complicated Leave Request process in PowerApps using an Azure SQL database.


We have several types of leave :- holiday, parental, sickness, overtime, emergency (to name a few!)


I have created my backend relational database with the common fields such as RequestID, RequestorID, ApproverID, SubmitDate etc. in a "LEAVE_REQUEST" table, then I have the From / Until dates in a "DATES" table (as some leave types allow multiple selections so will need repeating rows) and then have created seperate tables for the unique questions related to all the types of leave possible.


Is there a way to be able to create some form of dynamic form that loads the relevant questions based upon the type of leave selected and then be able to write the values into the appropriate table (i.e holiday questions to the "HOLIDAY" table and the common questions such as approver and status into the "LEAVE_REQUEST" table - and be able to see all the requests made with general information in a gallery and then when different leave requests are selected from the gallery, load the relevant leave type tables to display the details for that request?


Can I build it once (in an efficient manner), or do I need to builde seperate forms complately for each type?


Any assistance would be greatly appreciated.



Community Support
Community Support

Re: Dynamic Form with multiple SQL tables

Hi @alunhughes ,


You could try to implement different table names as the data source of Form control according to different conditions using the If function. 

About If function:




Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Check this Out


Class of 2020- Season 2

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!


Return to Workplace

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


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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