Purpose: Build a web-based application to allow the users to update and view the warehouse contact list so that team members can work with operation team more efficiently.
Tool:
User Interface: PowerApps
Backend DB: MS SQL Server
Steps
1. Create a table in MS SQL Server as backend source of application.
CREATE TABLE [dbo].[Tutorial](
[Warehouse_ID] [nvarchar](255) NOT NULL,
[Address] [nvarchar](268) NULL,
[City] [varchar](7) NOT NULL,
[State] [varchar](2) NOT NULL,
[Zip] [nvarchar](255) NULL,
[Phone] [nvarchar](260) NULL,
[Manager] [nvarchar](262) NULL,
[ManagerEmail] [nvarchar](274) NULL,
[Receiving] [nvarchar](264) NULL,
[ReceivingEmail] [nvarchar](276) NULL,
[Returns] [nvarchar](262) NULL,
[ReturnsEmail] [nvarchar](274) NULL,
[InventoryControl] [nvarchar](271) NULL,
[InventoryControlEmail] [nvarchar](283) NULL,
[Shipping] [nvarchar](263) NULL,
[ShippingEmail] [nvarchar](275) NULL,
PRIMARY KEY CLUSTERED
(
[Warehouse_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Note: Make sure you create primary key for this table, which will be required when we design update contact info hit on the backend DB via Patch function.
2. In PowerApps canvas, create user interface for the contact App.
- Warehouse Dropdown Selection:
1. Item: Select Data Source [dbo].[Tutorial]
2. Value: Warehouse_ID
- WH Info: Allow users to view and maintain Warehouse info (Address, Phone, etc).
- WH Contact: Allow users to view and maintain Warehouse contact.
- Create New Entry: Allow users to create new Warehouse.
- View & Download: Allow users to view and download information.
3. WH Info:
In the page, it include WH info such as address, phone number, etc.
- Each text input box sources the information from the table of [dbo].[Tutorial].
Concat(
Filter(
'[dbo].[Tutorial]',
Warehouse_ID = WHDD.SelectedText.Value )
, Address & " ")
- In update icon, use Patch function to write the updated info back to the table [dbo].[Tutorial].
Patch('[dbo].[Tutorial]',First(Filter('[dbo].[Tutorial]',Warehouse_ID=WHLB.Text)),
{
City: CityTextInput.Text,
State : StateTextInput.Text,
Zip: ZipTextInput.Text,
Phone: PhoneTextInput.Text,
Address:AddressTextInput.Text});
Enjoy it :)