Monday, April 17, 2023

How to Change Label Text in Form using JavaScript in Model Driven Apps

Introduction:

In this Blog we will see how to Change Label Text in Form Using JavaScript in Model Driven Apps.


Implementation Steps:

 

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

 

2. Click More --> Select Tables

 

3. Open the Table where you want to change the Form Text

 

In my Scenario I need to Change the Text Based on Boolean Field.

 

4. Boolean Field

  • Name : Change Text
    • Yes --> If yes then Change Text to Selected Yes
    • No --> If No then Change Text to Selected No

5. Now Create a Web Resource then Upload Below Code

 

function onChangeBooleanField(executionContext) {
    var formContext = executionContext.getFormContext();
    if (formContext.getAttribute("crd20_changetext").getValue()) {
        formContext.getControl('name').setLabel('Selected Yes');
    } else {
        formContext.getControl('name').setLabel('Selected No');
    }
}

 

// crd20_changetext --> Boolean Field Logical Name

//name --> Label to be Changed

 

6. I have Written function in OnChange of Boolean Field

 

7. Once Code Written Refresh the Account Form

 

rampprakash_0-1681723093204.png

 

As i said written Code in On Change

 

Now if i change Value to Yes then You will see Selected Yes as Label

 

rampprakash_1-1681723130587.png

 

 

Now if i change to No then You will see Selected No as Label

 

rampprakash_2-1681723649432.png

 

 

That's it :slightly_smiling_face:

 

Using Change label in JavaScript we can change the Label Text.

Friday, March 17, 2023

How to Convert Speech to Text from Canvas PowerApps (Part III Microsoft Flow)

Introduction:


In this blog we will see how to Configure Microsoft flows for Converting Speech to Text


Lets see this in 3 Different Blogs, Here we start with Microsoft Azure

 

Pre-Requisites :

 

 

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

 

2. Select New --> Select Instant Cloud Flow

 

3. Add Step --> Initialize Variable

 

rampprakash_0-1679038194550.png

 

Add Value as ASK FROM POWERAPPS

4. Add Another Variable

 

rampprakash_1-1679038220574.png

 

replace(variables('Data'),'data:audio/webm;base64,','')

 

5. Add Compose to Convert to JSON

 

rampprakash_2-1679038268441.png

 

json(variables('ReplaceValues'))

 

6. Now Add Parse JSON and Pass input from COMPSE

 

rampprakash_3-1679038308430.png

 

 

{
    "type": "object",
    "properties": {
        "Url": {
            "type": "string"
        }
    }
}

 

7. Get the Value from JSON and Pass value as URL

 

rampprakash_4-1679038361172.png

 

8. Trigger a HTTP Request to Function app (URL : Function APP URL)

 

rampprakash_5-1679038428381.png

 

9. Trigger HTTP Request for Cognitive Service with KEY and Content Type

 

rampprakash_6-1679038496948.png

 

Here the URL will be Your Cognitive URL and Key as Cognitive Key

 

10. Parse JSON and the Input from Point 9

 

rampprakash_7-1679038558575.png

 

 

{
    "type": "object",
    "properties": {
        "RecognitionStatus": {
            "type": "string"
        },
        "Offset": {
            "type": "integer"
        },
        "Duration": {
            "type": "integer"
        },
        "NBest": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "Confidence": {
                        "type": "number"
                    },
                    "Lexical": {
                        "type": "string"
                    },
                    "ITN": {
                        "type": "string"
                    },
                    "MaskedITN": {
                        "type": "string"
                    },
                    "Display": {
                        "type": "string"
                    }
                },
                "required": [
                    "Confidence",
                    "Lexical",
                    "ITN",
                    "MaskedITN",
                    "Display"
                ]
            }
        },
        "DisplayText": {
            "type": "string"
        }
    }
}

 

10. At last Respond to PowerApps

 

rampprakash_8-1679038591429.png

 

 

That's it :slightly_smiling_face:

 

Wednesday, March 1, 2023

How to Convert Speech to Text from Canvas PowerApps (Part II Azure)

Introduction:


In this blog we will see how to Configure Microsoft Azure for Converting Speech to Text


Lets see this in 3 Different Blogs, Here we start with Microsoft Azure

 

Pre-Requisites :

 

 

1. Navigate to https://portal.azure.com

 

2. Click Search and Search for Resource Group

 

rampprakash_0-1677647304786.png

 

3. Input the Resource Group name and Click Review and Create

 

4. Once the Resource Group is Created then Click On Search at the Top and Search for FUNCTION APP

 

5. Now Create a New Function App like below Image

 

rampprakash_1-1677647435677.png

 

6. Now Click Review and Create

 

7. Once Function App Created Open the Function App and Search for Functions --> Select Create --> Select HTTP Trigger --> Select New Function and Click Create

 

rampprakash_2-1677647551701.png

 

8. Once the Function App is Created, In the Function App Search Search for Advance Tools  and Click GO

 

9. It will Open a POP-UP Click DEBUG and Select CMD

rampprakash_3-1677647847326.png

 

10. Once Page Loaded Click Site Folder --> wwwroot

 

rampprakash_4-1677647895087.pngrampprakash_5-1677647928265.png  

 

11. Once the WWWROOT Loaded Select NEW and Select New Folder

 

rampprakash_6-1677647985501.png

 

 

12. Name it as "webm-to-wave"

 

13. Now go this Link and Select Windows and Download the File

 

14. Once the File is Downloaded Extract the File and GO to BIN and You can see Below Three Files

 

rampprakash_7-1677648188133.png

 

15. Drag and Drop it to the Folder which we Created

 

16. Once the File is Uploaded Go one Step Back there you can See the AZURE FUNCTION WHICH YOU CREATED

rampprakash_8-1677648247202.png

 

17. Open that and Click New and Create a File function.json / readme.md / run.csx

 

18. Here is my GITHUB link you can see the Files which need to be available in function.json/readme.md and run.csx 

 

19. Once Done Click Save.

 

20. Now Again Navigate to https://portal.azure.com

 

21. Search for Speech Services

 

rampprakash_9-1677648439244.png

 

 

22. Create a new Speech Services like below and Click Review and Create 

 

rampprakash_10-1677648499694.png

23. Once the Speech Service is Created Open it and Select KEYS and ENDPOINT

 

24. Copy the KEY and ENDPOINT

 

rampprakash_11-1677648613872.png

 

That's it For Azure :slightly_smiling_face:

 

In Next Blog, we will see how to Write Microsoft Flow to Achieve Speech to Text

How to Convert Speech to Text from Canvas PowerApps (Part I Canvas App)

Introduction:


In this Blog, we will see how to Convert Speech to Text From Canvas PowerApps with Part 1 Canvas Apps


Lets see this in 3 Different Blogs, First we Start with Canvas PowerApps

 

Pre-Requisites :

 

 

1. Canvas PowerApps :

 

rampprakash_1-1677500143211.png

  • And Click Create
  • Select Insert --> Select Microphone

rampprakash_2-1677500322386.png

  • In the OnStop of the Microphone Input the Below Values

rampprakash_3-1677500433705.png

 

 

 

ClearCollect(
    AudioCollection,
    Microphone1.Audio
);
Set(
    JSONValue,
    JSON(
        AudioCollection,
        JSONFormat.IncludeBinaryData
    )
);

 

 

 

Here Microphone1 is name of Microphone media

 

  • Now Click Insert and Add Audio

rampprakash_4-1677500525759.png

 

  • Select Audio And Click Media and Paste the Below Code

rampprakash_5-1677500595748.png

 

 

 

Microphone1.Audio

 

 

 

This Code Uses when ever you tired to Record By Speech you can hear Back from AUDIO option by Playing

 

  •  Now Add a Button and Name it as SUBMIT (or) Convert to Text
  •  Select Power Automate at the Left Side of the Tab and Click Add New Flow

rampprakash_0-1677646789273.png

  • You will see in Next Blog How to Create a MICROSOFT FLOWS in Next Blog

How to Run Microsoft Flow for Every one Month

Introduction: In this Blog we will see how to Run Microsoft Flow for Every one Month. Implementation Steps:   1. Navigate to  https://make.p...