PowerApps is a tool provided by Microsoft which lets you build business apps quickly using data from Microsoft and Non-Microsoft services. To get data from NAV 2017 into PowerApps we will need to set up a connector.
- Microsoft Office 365 account with PowerApps plan or trial enabled
- Dynamics NAV 2017 with NavUserPassword enabled since windows authentication is not supported. Please follow this awesome blog by Saurav Dhyani if you need help setting it up.
- Public IP on NAV server so that the connector can connect and fetch data from tables.
- Basic NAV knowledge
- Create a new user in NAV. This can be done by searching for ‘Users’
- Click on New and enter User Name and then generate a webservice key. This key will be used by connector as password.
Note your username and webservice key as they will be need in further steps.
- Go to WebServices page and Click on new. Select object type as Page , and number as 31. Enter itemlist in Service Name and then click on Publish.
- Click on Reload. Copy the OdataV4 URL from this page.
It should be of the form
http://<server IP>:<OdataPort>/<your instance name>/ODataV4/Company(‘CRONUS%20Canada%2C%20Inc.’)/itemlist
- Next step is to Open powerapps web portal by going to https://web.powerapps.com/
You may have to login to your Account.
- Click on Connections on the left pane and Click on NEW CONNECTION on top right
- Select Dynamics NAV from the list and click on + button next to it.
- This will open a form. Enter your generic odatav4 url. Don’t add company or service name part of the URL.
For Example: http://<server IP>:<OdataPort>/<your instance name>/ODataV4/
Enter Username of the user you created and Webservice key in Password field.
Enter your Nav Company name.
Click on Create.
- Click on + New App button on bottom left.
- Click on the Right Arrow in Start with your data icons.
- Select Dynamics NAV. Select Default.
- Select itemlist and click on connect on the choose table list.
- This will start building the app. Basically PowerApps will try and build a app based on the itemlist webservice.
- Once its ready the app can be customized.
- At this point you can play around with different settings and options to customize the app.
For Example I am going to change the layout of the BrowseScreen1 to include images. Layout can be found under Data Tab.
- Next , change the fields to be shown on this screen. This is done by changing the subtitle 2 to Description and Title 2 to No.
- Next we want that clicking on the image opens the details page of the Item. This is done by selecting the image and going to Advanced tabe. Then change the OnSelect property from false to Navigate(DetailScreen1, ScreenTransition.None)
- Click on Play to see how your App looks
- Pressing X on the top right brings back to design window. Once you are ready with your app. GO to File and select SAVE. This will save your app and you can access or share it to your organization through office portal.
As you can see the images are not yet pulled from NAV. This is because NAV saves images in a Media/Mediaset data type which is not recognized in powerapp. I have found a workaround which is will explain in the next blog post. Stay tuned.
Link to Part2