Wednesday, May 18, 2022

How to Set Model Driven App theme in PowerApps Canvas

Introduction:


In this Blog we will see how to set Model Driven App theme in PowerApps Canvas


Implementation Steps:

 

Model Driven Apps:

 

1. Navigate to https://make.powerapps.com

 

2. Click Gear Icon at the Top --> Select Advance Settings 

 

3. Once the Page Loaded --> Click Customization --> Select Theme --> You will see Default Theme ( You can see only one default theme for an Application)

 

COPY THE NAME OF THEME

 

rampprakash_0-1652872015072.png

 

4. Now go to https://make.powerapps.com

 

5. Click App --> And Provide the Name for the App and select Tablet or Phone Mode based on your needs --> In this i have selected Tablet Mode

 

rampprakash_1-1652872425930.png

 

6. Click DataSource --> Select Theme DataSource

 

rampprakash_2-1652872577998.png

 

7. Once the DataSource Added In the On Start of App Paste the below code

 

Set(getThemeValues,LookUp(Themes_1,'Default Theme'='Default Theme (Themes_1)'.Yes));

 

  1. Get the Value from Lookup in Theme with Default Theme as Yes

 

8. Add Multiple Labels in the Form

 

rampprakash_3-1652872738660.png

 

9. Now Based on the Theme we can load the values(getThemeValues)

 

10. Now Add one by one to the LABEL : FILL and Label Text

 

rampprakash_4-1652872838797.png

 

ColorValue(getThemeValues.'Legacy Accent Color')
ColorValue(getThemeValues.'Navigation Bar Fill Color')

 

11. Based on the Above code we can use the color in different places according to Model Driven App

 

Final Output

 

rampprakash_6-1652873257380.png

 

 

That's it :slightly_smiling_face:

 


Monday, May 9, 2022

What's my IP for Microsoft Flow?

Introduction:


In this blog, we will see how to Retrieve IP Address for Microsoft Flow


Scinario:

 

I want to get Response from WebService, that service is restricted to some of the IP Address. I need to get that Service Using Microsoft Flow, So i need to get IP Address of Microsoft Flow to add that IP Address manually to service to get the values.

 

Let's see how we can achieve this.

 

 

Implementation Steps:

 

1. Navigate to https://flow.microsoft.com

 

2. Click New App --> Select Instant Cloud Flow

 

rampprakash_0-1652086160420.png

 

 

3. Input Name For the Flow and Select PowerApps

 

rampprakash_1-1652086203787.png

 

4. Select HTTP Trigger

 

rampprakash_3-1652086268645.png

 

5. Select Method as GET and Input URI as

 

 

 

https://api.ipify.org/?format=json

 

 

 

6. Now Save the Flow 

 

7. Click Test at the Top Right and Select MANUAL trigger --> Select Run Workflow

 

That's it :slightly_smiling_face:

 

rampprakash_4-1652086554079.png

 

 

8. You can see the IP address in BODY of result.

Monday, April 25, 2022

How to Retrieve More than 256 Rows from Excel using Microsoft Flow

Introduction


In this Blog we will see how to retrieve More than 256 Rows from Excel using Microsoft flow


Implementation Steps:

 

1. Create an Excel or Upload the Existing Excel in OneDrive.

 

2. Open the Excel and Check How Many Rows Available. in my case i have 373 Rows Available

 

rampprakash_0-1650869401774.png

 

3. I Uploaded it in OneDrive

 

rampprakash_1-1650869425619.png

 

4. Once Done ---> Navigate to https://flow.microsoft.com

 

5. Click Instant Cloud Flow and Select PowerAutomate and Input Name for the Flow

 

rampprakash_2-1650869494356.png

 

6. Once Clicked On Create --> Select Excel Online (Business) --> Then Choose List Rows Present in Table

 

rampprakash_3-1650869629504.png

 

7. Then Select the location Where the Excel is Available

 

rampprakash_4-1650869741699.png

 

8. Now for Testing Purpose i will Add a Apply For Each to Check How Many Rows its Retrieving.

 

rampprakash_5-1650870506453.png

9. Now We are done --> Click Test --> And Expand Apply to Each 

 

rampprakash_6-1650870708019.png

 

10. Now you can see only 256 Record Retrieved

 

11. Let's See how we can change this

 

12. Click On Three Dots in Excel (List Rows Present in the Table) and select Settings

 

rampprakash_7-1650870804833.png

 

13. Turn On Pagination and Select Threshold Value to 1000(it Depends) and Click DONE

 

rampprakash_8-1650870859381.png

 

 15. Now --> Save the Workflow and Test Again

 

16.  Now you can see all the Rows from Excel.

 

rampprakash_9-1650870963609.png

 

That's it :slightly_smiling_face:

Wednesday, April 13, 2022

How to Concatenate String in Canvas PowerApps

Introduction:


In this Blog we will see how to Concatenate String in Canvas PowerApps


Implementation Steps:

 

1. Navigate to https://make.powerapps.com

 

2. Click Apps --> Click New --> Select Canvas App --> Then Input Canvas Name and Select Tablet or Phone and  Click Ok

 

rampprakash_0-1649846493428.png

 

3. Add a Label Field By selecting Insert 

 

4. Using C# or Any Other Code we can Simply Concatenate the Values like below

  • "Hi" + " Welcome" + " to" + " PowerApps"

5. But in Canvas we need to use it in Different way

 

Lets see how we can Concatenate in Canvas PowerApps

 

Instead of using + we need to use & Operation for Concatenating the String values

 

 

"Hi"&" Welcome"&" to"&" PowerApps"

 

rampprakash_1-1649846837792.png

 

That's it :slightly_smiling_face: 

Tuesday, April 12, 2022

Clone OOB/Custom Entities in Dataverse Environment using Plugins

Introduction:

In this Blog, we will see how to clone OOB/Custom Entities in Dataverse or MSCRM Environment.

Scenario:

 

Consider I have an Opportunity Entity Available, once the Opportunity is WON or LOST, we want to Clone that Opportunity with Exact Same Details.

 

Let's see how we can achieve this. 

 

Note:

 

This Code is not only Restricted to OOB Entity, we can use this code in Custom Entity too

 

Implementation Steps:

 

You can write the below code in your Plugins.

 

 

Entity getOpprotuntiyRecord = (Entity)context.InputParameters["Target"];
Entity cloneRecord = service.Retrieve("opportunity", getOpprotuntiyRecord.Id, new ColumnSet(true));
cloneRecord.Attributes.Remove("opportunityid"); cloneRecord.Id = Guid.NewGuid(); Guid getCreatedOpportunity = service.Create(cloneRecord);

 

 

In the Above Code i mentioned as 

 

opportunity --> Change it based on your Entity Logical Name

opportunityid --> Entity Logical Name Primary Unique id name

 

That's it :slightly_smiling_face:

 

If Suppose you want to add some value to NAME Field while Cloning means you can write below code

 

Entity cloneRecord = service.Retrieve("opportunity", getOpprotuntiyRecord.Id, new ColumnSet(true));
cloneRecord.Attributes["name"] = cloneRecord.Attributes["name"].ToString() + " Renewal"; cloneRecord.Attributes.Remove("opportunityid"); cloneRecord.Id = Guid.NewGuid(); Guid getCreatedOpportunity = service.Create(cloneRecord);

 

You can Just Add the LOGICAL NAME while replacing.

Thursday, April 7, 2022

Disable Auto Save for Individual Forms in Model Driven Apps

Introduction:


In this Blog, we will see how to Disable Auto Save Functionality on Particular Form Using JavaScript.


Implementation Steps:

 

In my Previous Blog I have explained how to enable or disable AUTO Save functionality in Model Driven Apps. In this Blog we will see how to Prevent Auto Save in Particular or Individual forms using JavaScript.

 

Steps to Follow:

 

1. Navigate to https://make.powerapps.com

 

2. Navigate to Solution and Open the Solution which you already have else Create a New Solution

 

3. Create or Add Existing Table where you want to Prevent Auto Save functionality.

 

4. Once Table is Added, Add your Existing Web Resource. Else Create a new Web Resource.

 

5. Steps to Follow to Create a Web Resource

 

6. Add below JavaScript into your Web Resource

 

 

 

function preventAutoSave(executionContext) {
    var formContext = executionContext.getFormContext();
    var eventArgs = executionContext.getEventArgs();
    if (eventArgs.getSaveMode() == 70) {
        eventArgs.preventDefault();
    }
} 

 

 

 

7. Please find the Event Modes that will perform on SAVE operation

 

Event ModeValue
 Save1
 Save And Close2
 Save and New59
 Save as Completed58
 AutoSave70

 

8. Now Open the Table where you want to add Web Resource --> Click Forms --> Open the Form

 

9. Once Form Opens Click Form Library and Click Add Library and Search for the Library and Select the Check Box and Click Add

 

rampprakash_0-1649167174499.png

 

10. Once Added --> Click Events at the RIGHT Side --> Select OnSave --> Click ADD EVENT HANDLER --> Input Function name as preventAutoSave --> Make Sure You Select Check Box - Pass Execution Context

 

11. Now Click Ok --> Click Save and Click Publish.

 

That's it :slightly_smiling_face:

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...