<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=612681139262614&amp;ev=PageView&amp;noscript=1">
Skip to content

Need help? Talk to an expert: phone(904) 638-5743

Creating a Salesforce Application with PowerApps

Creating a Salesforce Application with PowerApps

powerappslogoWant to learn how to sell more by integrating PowerApps into Salesforce? One of our Sales Managers, Gina Ostrowsky, asked about finding an app that would allow her to sell more from her phone when she’s out and about. Gina was looking for an app that would pull up leads and contacts within the demographics wherever she is travelling.

In a series of posts, I’ll show you how to create a new application that connects to Salesforce.com, making it easy for sales reps to review their leads and contacts from their phones.

I’ll be using PowerApps to build an app to integrate with Salesforce and do what Gina is looking for. This same theory can be used in Dynamics, Base Camp or other sales platforms. We’ll also add some geographic integration so she can tie into Google Maps to see what leads are near her and exactly where they are located.

  • I’ll start in PowerApps.com and I click on Start from Data to build this app from data and connect to data sources I already have.
  • Once I’ve logged in, it will take me to the PowerApps Studio, and I’ll start by connecting to my Salesforce account. You can do a lot with this connector; it will allow you to create new leads, modify or delete leads and to see geographic location of them.
  • Next, I choose a table from the list of entities. I start with my accounts entity, which are the Pragmatic Works’ companies, then I’ll drill from accounts into contacts and from contacts we’ll see what activities and cases there are.
  • Once I select accounts, PowerApps will create three screens; one for the creation events or the creation of new leads, one for the updating and deleting of leads/accounts and in this case one for the Read operation. It creates this for us in 20-30 seconds.
  • After it’s created, we can see it’s pulling the accounts in but when I select it, I’ll see it has a bunch of custom fields showing some default behaviors that I don’t want. I only want to search on the account name. So, I remove these other custom fields and only search for and sort by the account name.
  • This app will search and pull all of the 70,000 accounts we have at PW; what I could do is narrow that down by adding a ‘where clause’ against Salesforce that is very restricted at first, otherwise it will take some time for the application to load as it pulls over all the accounts. Adding a spinner (which I covered in my last blog) can be very handy here.
  • Next, I’ll choose the layout of the gallery (I simply go with Title and Subtitle) and type what I want to see in the code bar (see the video included for more detail on this).
  • Now when I run this app and type something into the Search bar, like Pragmatic Works, I can click on the chevron icon and drill into the details of Pragmatic Works. But I notice I need more real estate than what I’m seeing come up.
  • When I began this app, I noted that when I start with data as I did, I must go through and start these entities as a phone view, so my next task is to make this a tablet view.
  • I do this by going to File and App Settings and I’ll give my app a name and create an icon for it. Plus, I change my screen orientation to landscape which gives me lots of real estate to work with.
  • One thing to note is that Salesforce allows you lots of flexibility with delegations or in other words pushing of your filters into Salesforce, so it’s not returning your whole dataset but only the datasets you need. There’s a couple gotchas here so I’ve included a doc on understanding delegation and is/is not delegable in Salesforce: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview#delegable-data-sources.
  • In the landscape version of my app, I want the left area to be account information and on the right all the people in that account, and above that a map of where that account is (which I cover in my next installment).
  • I go ahead and rename my galleries/entities. One thing PowerApps does is as we rename these entities and if there was any code pointing to it, it would also change that code as well.
  • Next, I’ll create a new gallery for the right side of my app. Then I’ll add another connection to Salesforce and bring in the contact entity. This will bring in what contacts are part of this company.
  • My goal with this gallery is when I click on the chevron icon, it will take me to a new screen showing all the activities for that contact and maybe even a phone button where I can click and connect right from my phone.
  • I then add some background colors to make it easy to identify that there are different zones within the app.
  • At this point, I’m seeing all the contacts across all my environments when I only want to see the contacts listed for the account on the left side. To fix this I’ll add a filter option, and this will be delegable, and Salesforce will only give me back what I need. I’ll add a filter to filter contacts that are equal to the Account ID that was passed in on the previous screen. (Check out the video to see the exact code for this).
  • On the left screen I go in and structure or reorder the fields so the fields I care most about are at the top. The billing cities and countries we will need later when we go in and add a map against this so Gina can go into a city and see what is around her and we’ll use the Google APIs for that. When I deploy this to my phone, things like latitude and longitude are available.
  • My next goal is when I go into an account and hit the edit button, I want to make changes to a field (annual revenue for instance) and when I hit the go button and go to Salesforce and get the URL for the company to link directly, so Gina can click on that from her phone and open the full Salesforce record.
  • I will copy that Salesforce link and add an icon to my app where Gina can click and hop right to that Salesforce record. I need to add an On Select event which will be to launch Salesforce.com with this icon. To do this I choose On Select and type Launch plus that URL in my code bar and the ID of what I’m currently looking at so in my case: galbrowseaccounts.selected.ID. This allows us to click on that icon and drill down for more information.

So, we used the Wizard inside of PowerApps to get started today. Be sure to watch the demo in my video for a more detailed view. In the next post I’ll add some geography inside my app by building maps into it, as well as eventually add some workflows to it. The goal with this app is to help our sales reps to sell more and be more productive using PowerApps.

If you need more training on PowerApps, our On-Demand Learning platform has over 50 courses covering PowerApps and the Power Platform, Business Intelligence, Azure, SQL Server and much more. How about starting with a free PowerApps course? Pragmatic Works, in partnership with Microsoft, is pleased to offer our FREE App in a Day course with amazingly detailed labs covering the capabilities of PowerApps. Click the link below to subscribe to your free course today!

Sign-up now and get instant access

Leave a comment

Free Trial

On-demand learning

Most Recent

private training

Hackathons, enterprise training, virtual monitoring