Wednesday, 28 October 2020

PowerApps - Convert Twitter Post to Lead & Case in Canvas App


Hi Everyone,

Welcome to the Power Guide Mentorship Program. Today I am going to share 💪PowerGuideTip21💪, where I will show you how sales agents can access the Twitter post in their mobile app and can convert it to Lead or Case directly based on need.

Business Requirement

Being a Sales Agent, I want to view all Twitter posts where a customer has talked about Power Community in their Twitter post. Based on the post, the agent should have an option to convert it into Lead if it seems to be a new opportunity and convert it to Case if it seems to be escalation or complaint.

Let's get started...

Step 1 - Create a Canvas App or Use any existing app



Step 2 - Add a screen of 'List' type to show Twitter Post based on a particular keyword.


Step 3 - Go to View > Data Sources > Connect to Twitter

Step 4 - Design the screen as below (or as per your requirement)

Search all twitter post contains the keyword 'PowerCommunity'

Show User's Fullname and Location who posted the Tweet


Show Tweet Text


Navigate to Details Page to show more details about the Tweet

ClearCollect(tweetColl,{username:ThisItem.UserDetails.FullName,userlocation:ThisItem.UserDetails.Location,userimage:ThisItem.UserDetails.ProfileImageUrl,usertweet:ThisItem.TweetText, usertweetdate: ThisItem.CreatedAt,userfollowers: ThisItem.UserDetails.FollowersCount});

Navigate(TwitterPostDetails,ScreenTransition.CoverRight);


Create Lead on click of Convert to Lead button.

Patch(Leads, {cr83e_subject: "Lead from Tweet: "&ThisItem.UserDetails.FullName,cr83e_username: ThisItem.UserDetails.FullName,cr83e_description: ThisItem.TweetText });

Navigate(LeadsList,ScreenTransition.Fade);


Create Lead on click of Convert to Case button.

Patch(Cases, Defaults(Cases), {cr83e_title: "Case from Tweet: "&ThisItem.UserDetails.FullName,cr83e_description: ThisItem.TweetText});

Navigate(CaseList,ScreenTransition.Fade);


Step 5 - Add a blank screen to show the details screen (if required) to show the Twitter post in more detail.

Step 6 - Add two more screens of 'List' type to show Leads and Cases created directly through Twitter Post.



Step 7 - Test the App



Monday, 26 October 2020

PowerApps - Dynamically change theme of all the Screens in Canvas App


Hi Everyone,

Welcome to the Power Guide Mentorship Program. Today I am going to share 💪PowerGuideTip20💪, where I give you a Tip about changing the theme of the canvas app screens dynamically.

There are umpteen business requirements, where the client wants to have the feature/option in Canvas App to change/control the theme of all the canvas app screens from a single screen, instead of changing the theme or control properties from each screen individually.

Today, I am gonna demonstrate that Tip with you, that I had also demonstrated in the 365 Saturday PowerApps Event as well. Check here -  PowerApps Best Practices

Let's get started...

Step 1 - Create a Canvas App  or Use your existing Canvas App



Step 2 - Add a Profile Screen to view your profile information

To add the Profile Screen, I have added one Blank Screen and added one Rectangle which covers half of the screen to display my profile information, and added a few Circles to provide change theme options.



Step 3 - Add change theme option on Profile Screen

Filled the Circle with the Colors you want to change the theme as per your requirements. I have used Yellow, Blue, Green, and Purple for the demonstration purpose. 

Also added my Image and logged In user name by setting the Label Text property to User().fullname.


Step 4 - Add Logic to change the theme of all the screens from Profile Screen

Logic on Profile Screen - 

Here I have used two Canvas App Global Variables to set the color of the theme and font of all the screens.

Set(mytheme,RGBA(109, 49, 162, 1));
Set(fontcolor,RGBA(109, 49, 162, 1));

This is just an example of how you can change/manage the control settings of the canvas app through variables dynamically. You can use this tip to manage the other properties as well like height/width/background color etc.


Logic on Customer Screen (Home) - 

Here, I have passed the variable name (setting the color value on the profile screen dynamically) on the control property instead of using color code directly.

Change Rectangle 'Fill' Property


Change Textbox 'Color' Property

Step 5 - Demo




Important Note: It's always a good practice to keep your canvas app screens control property dynamic to make your canvas app responsive and to change the control property without any hassle and with less effort, Otherwise, it would be very difficult to change the control property of all the screens manually.

Please always this Tip keeps in mind while designing a canvas app screen. Especially, when you are designing an app with 10-15 screens.

Hope this PowerGuideTip helps you to design an effective canvas app with minimal effort.

Stay Tuned for PowerGuideTip21. Cheers!
Blogger Widgets