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

Where to store data for “create an account” screen?

I created an “create an account” screen but where would I store the data and then retrieve back for the login page?
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
TopShelf-MSFT
Level 10

Re: Where to store data for “create an account” screen?

Hi @WatermelonCat - here are the solutions suggested in the linked posts you can't access. 

 

Based on the needs that you mentioned, I have made a test on my side, please consider take a try with the following workaround:

1. If you add a Edit form in your Login screen, and connect the Edit form to your Excel table (set the DataSource property of the Edit form to your Excel table):

Set the OnSelect property of the "Submit" button within Login screen to following:

SubmitForm(Form1);    /* <-- From1 represents the Edit form in your Login Screen */
Navigate(HomeScreen, ScreenTransition.None)

2. If you do not add a Edit form in your Login screen (just using some simple Text Input box controls to collect user's input), and do no connect it to your Excel table:

Set the OnSelect property of the "Submit" button within Login screen to following:

Patch(
         'YourExcelTable',
          Defaults('YourExcelTable'),
          {
            User: UserInputBox.Text,
            Password: PasswordInputBox.Text
          }
);
Navigate(HomeScreen, ScreenTransition.None)

Note: The UserInputBox and PasswordInputBox represents the Input Box controls in your Login Screen.

More details about the Patch function, please check the following article:

Patch function

 

In addition, if you have owned a Uer Info Table (including Username and Password), and just want to validate if the login user typed a proper username and password, please consider take a try with the following workaround:

Set the OnSelect property of the "Login" button to following:

If(
   IsBlank(LookUp('UserInfoTable', User = UserInputBox.Text)),
   Notify("Username is not existing", NotificationType.Error),
   If(
      LookUp('UserInfoTable', User = UserInputBox.Text, Password) <> PasswordInputBox.Text,
      Notify("The Password you typed for the current user name is wrong", NotificationType.Error),
      Navigate(HomeScreen, ScreenTransition.None)
   )
)

Based on the needs that you mentioned, I think the SaveData function and LoadData function, and a Checkbox control could achieve your needs.

I have made a test on my side, please take a try with the following workaround:

 

 

 

 

 

Set the OnStart property of the App control to following:

LoadData(LoginCollection, "LoginColl", true)

Set the Default property of the Username Textbox control to following:

If(!IsEmpty(LoginCollection), First(LoginCollection).Username)

Set the Default property of the Password Textbox control to following:

If(!IsEmpty(LoginCollection), First(LoginCollection).Password)

Set the OnCheck property of the Checkbox control to following:

ClearCollect(LoginCollection, {Username: Username.Text, Password: Password.Text});
SaveData(LoginCollection, "LoginColl")

Note: Currently, within PowerApps, the SaveData function and LoadData function only works in Mobile device, which could not used inside a browser, either when authoring the app in PowerApps Studio or when running the app in the web player.

More details about the SaveData function and LoadData function, please check the following article:

SaveData function, LoadData function

 

On your side, please consider run your app using PowerApps Mobile App in your Mobile device.

 

Please also check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/build-offline-apps-with-new-powerapps-capabilities/

 

@TopShelf-MSFT 

View solution in original post

6 REPLIES 6
Community Support Team
Community Support Team

Re: Where to store data for “create an account” screen?

Hi @WatermelonCat ,

Could you please share a bit more about the "Create an account" screen that you mentioned?

Do you want to store the added account from your "Create an account" screen within your app?

 

Based on the needs that you mentioned, I think there are many data source could achieve your needs, e.g. Excel table (hosted in OneDrive, SP List, CDS Entity, ...)

 

On your side, you could consider create a Excel file in your OneDrive folder, and add some related info within it, e.g. Account Name, Email, Address, Job Title, Department, ... etc. Then format this Excel file data as a Table.

After that, create a connection to the Excel table (hosted in your OneDrive folder) from your app. Then you could use the Patch function to patch the account info from your “create an account” screen to the Excel table. The standard Patch formula as below (set the OnSelect property of the "Submit" button):

Patch(
          'YourExcelTable',
           Defaults('YourExcelTable'),
           {
              AccountName: AccountNameTextBox.Text,
              Email: EmailTextBox.Text,
              Address: AddressTextBox.Text,
              ...
           }
)

More details about creating an app based on Excel table data source, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/get-started-create-from-blank

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/get-started-create-from-data

 

More details about the Patch function, please check the following article:

Patch function

 

In addition, if you want to validate the added account within your Login Screen of your app, please check and see if the response within the following threads would help in your scenario:

https://powerusers.microsoft.com/t5/Creating-Apps/Save-in-Excel/m-p/296561

https://powerusers.microsoft.com/t5/Expressions-and-Formulas/save-username-and-password-field-in-log...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
WatermelonCat
Level: Powered On

Re: Where to store data for “create an account” screen?

Basically I have two screen.
The first screen is a simple login screen where it shows a text input for username and password. The second screen is a create an account screen that asked the user for their username, password, and email.
(Side note - this app is for a project for middle schoolers and they wanted to have their own accounts)
The only problem is I have no idea how or where to store the information. Also, the code needed to find the certain username and password for the login screen.
Community Support Team
Community Support Team

Re: Where to store data for “create an account” screen?

Hi @WatermelonCat ,

Yeah, I think the solution I provided above could achieve your needs. Have you taken a try with it?

 

Based on the needs that you mentioned, I think the Excel table data source (hosted in your OneDrive) could be used to store the account info for your end users.

 

If you want to validate the account name and password within your Login screen, please check the thread I mentioned above. The LookUp function could be used to validate the entered account name and password in your Login screen.

 

Please take a try with above solution I provided, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
WatermelonCat
Level: Powered On

Re: Where to store data for “create an account” screen?

I can't access the last two links and it says "You do not have sufficient privileges for this resource or its parent to perform this action". 

Highlighted
TopShelf-MSFT
Level 10

Re: Where to store data for “create an account” screen?

Hi @WatermelonCat - here are the solutions suggested in the linked posts you can't access. 

 

Based on the needs that you mentioned, I have made a test on my side, please consider take a try with the following workaround:

1. If you add a Edit form in your Login screen, and connect the Edit form to your Excel table (set the DataSource property of the Edit form to your Excel table):

Set the OnSelect property of the "Submit" button within Login screen to following:

SubmitForm(Form1);    /* <-- From1 represents the Edit form in your Login Screen */
Navigate(HomeScreen, ScreenTransition.None)

2. If you do not add a Edit form in your Login screen (just using some simple Text Input box controls to collect user's input), and do no connect it to your Excel table:

Set the OnSelect property of the "Submit" button within Login screen to following:

Patch(
         'YourExcelTable',
          Defaults('YourExcelTable'),
          {
            User: UserInputBox.Text,
            Password: PasswordInputBox.Text
          }
);
Navigate(HomeScreen, ScreenTransition.None)

Note: The UserInputBox and PasswordInputBox represents the Input Box controls in your Login Screen.

More details about the Patch function, please check the following article:

Patch function

 

In addition, if you have owned a Uer Info Table (including Username and Password), and just want to validate if the login user typed a proper username and password, please consider take a try with the following workaround:

Set the OnSelect property of the "Login" button to following:

If(
   IsBlank(LookUp('UserInfoTable', User = UserInputBox.Text)),
   Notify("Username is not existing", NotificationType.Error),
   If(
      LookUp('UserInfoTable', User = UserInputBox.Text, Password) <> PasswordInputBox.Text,
      Notify("The Password you typed for the current user name is wrong", NotificationType.Error),
      Navigate(HomeScreen, ScreenTransition.None)
   )
)

Based on the needs that you mentioned, I think the SaveData function and LoadData function, and a Checkbox control could achieve your needs.

I have made a test on my side, please take a try with the following workaround:

 

 

 

 

 

Set the OnStart property of the App control to following:

LoadData(LoginCollection, "LoginColl", true)

Set the Default property of the Username Textbox control to following:

If(!IsEmpty(LoginCollection), First(LoginCollection).Username)

Set the Default property of the Password Textbox control to following:

If(!IsEmpty(LoginCollection), First(LoginCollection).Password)

Set the OnCheck property of the Checkbox control to following:

ClearCollect(LoginCollection, {Username: Username.Text, Password: Password.Text});
SaveData(LoginCollection, "LoginColl")

Note: Currently, within PowerApps, the SaveData function and LoadData function only works in Mobile device, which could not used inside a browser, either when authoring the app in PowerApps Studio or when running the app in the web player.

More details about the SaveData function and LoadData function, please check the following article:

SaveData function, LoadData function

 

On your side, please consider run your app using PowerApps Mobile App in your Mobile device.

 

Please also check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/build-offline-apps-with-new-powerapps-capabilities/

 

@TopShelf-MSFT 

View solution in original post

WatermelonCat
Level: Powered On

Re: Where to store data for “create an account” screen?

I tried it but I'm doing something wrong and I don't know what it is. Also, I connected my excel from my sign up screen to my login in screen.

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,865)