Jesse
Jesse

Reputation: 21

How Can I Collect Data from a Button in PowerApps

I'm trying to create a form in PowerApps where a user clicks a button (called "I Agree") and the button then: -navigates to a thank-you screen (works fine) -captures that users login info and saves it in some type of list or database that I can reference later (no dice)

If not possible to complete this from a button, proposed workarounds?

Thanks, Jesse

Upvotes: 1

Views: 2276

Answers (1)

carlosfigueira
carlosfigueira

Reputation: 87228

Yes, this is possible. A few steps you'll take for that:

  • Create a connection to your database, selecting the table that you will want to use to save the user's information
  • If you want more information than the User function gives you(full name, e-mail) then you'll need to add a connection to the Office 365 connector where you can get more information. If name / e-mail are enough, you can skip this step
  • Add a button in the screen, setting its text property to "I Agree"

On the button's OnSelect property, perform the actions that you want. You can use ; (or ;; in locales where the number separator is ,) to perform multiple actions in a single rule. Below is an example, assuming that the DB table has two columns (Name, Email) and is named UsersTable):

Collect(UsersTable, { Name: User().FullName, Email: User().Email }); Navigate(ThankYouScreen, ScreenTransition.Fade)

Upvotes: 1

Related Questions