web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Building a form with d...
Power Apps
Answered

Building a form with data from multiple tables

(0) ShareShare
ReportReport
Posted on by 40

Hello

 

I'm new to PowerApps, but I am familiar with SQL and mobile programming. I'm currently having a hard time building a form, due to the fact that the data in it must come from multiple different tables.

 

These are the tables I'm working with:

 

QUESTIONARIES

QuestionaryID Description
0 "No questionary"
1 "Corrective" 2 "Follow-up" 3 "Start-up"
4 "Technical Visit"

OPTIONS

OptionID QuestionID OptionText
1 2 "Water pump"
2 3 "Oil Pump"
3 4 "Booster"
4 5 "Robot Arm"
...

QUESTIONS

QuestionID QuestionaryID OptionsID QuestionText
1 1 1 "Name of responsible person?"
2 1 37 "Which part is broken?"
3 1 1 "What caused the problem?"
4 2 2 "Number of burnt eletrodes?"
...

ANSWERS

AnswerID QuestionID AnswerText
196 19	 "Peter"
197 20 "10"
198 21 "No"
...

 

I have already build a screen where the user can choose what type of Questionary the user would like to fill. The idea is that in the next screen, the form with the questions included in the chosen type of Questionary will be available for the user to fill.

 

To do this, I want to build a Card for each question, which will include a Label with the question text and a drop down with the relevant options for the user to choose an answer.

 

Describing in pseudocode, basically what I want to do is:

 

chosenQuestionaryType = # User input from previous screen
for question in QUESTIONS.where(QuestionaryID = chosenQuestionaryType):
label.setText(question.QuestionText)
dropDown.setAvailableOptions(OPTIONS.where(QuestionID = question.QuestionID))

 

And each question needs to have its answer stored as a line in the ANSWERS table.

 

Is it even possible to achieve somethings like this with PowerApps? Or should I go with a more customizable solution, like building the app from scratch with code?

 

Thanks in advance,

Éber

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @eber_saj 

    It doesn't matter where the data for the controls in a form come from as long as the data is stored in one single place ie. the data source of the form.  The data source must be an actual table, not a variable or collection. 

  • Verified answer
    BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @eber_saj ,

     

    This is possible in PowerApps, but probably a Gallery will work better than a form.

     

    The Items property can be set for Filter(Questions, QuestionaryID = SelectedQuestionaryID). By adding a label to the gallery with ThisItem.QuestionText as the Text property, you can see the text for each of the questions. Besides the label, you need to insert a DropDown and set the Items property for Filter(Options, QuestionID = ThisItem.QuestionID)

     

    I then depends on the behaviour you want to save the data to the the Answers list to plan that part.

  • eber_saj Profile Picture
    40 on at

    Thanks a lot for the reply! Knowing which functions to use already give me a great starting point to go from.

     

    Do you also happen to know how I could pass values between screens?

     

    For example, I currently have this screen done:

     

    eber_saj_0-1650389954697.png

     

    When one of the arrows (>) is clicked, I want it it to take me to the form screen I am building, and also pass the index of the clicked option (0, 1, 2, 3 or 4) to this next screen.

  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @eber_saj ,

     

    To reference/pass values, you have multiple options.

     

    The first is through variables, either global (accesible throughout all screens of your app) or context (within the context of a screen). A value for a context veriable can be passed as an argument in the Navigate() function. More information on variables can be found here: https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/working-with-variables

     

    Another option is to refer to a control on another screen. In this case it would look something like: 

    Gallery1.Selected.ID

    This gives the ID value of the selected item in Gallery.

  • davidb4350 Profile Picture
    8 on at

    Do you mean that I cannot directly access data from multiple tables in an SQL database but rather need to bring the data from multiple SQL tables into one local table to work with that data in an app?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard