-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUse case 1 - Invoice Extraction.txt
More file actions
59 lines (56 loc) · 14.3 KB
/
Use case 1 - Invoice Extraction.txt
File metadata and controls
59 lines (56 loc) · 14.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Folder.GetFiles Folder: $'''C:\\Boot\\Invoices''' FileFilter: $'''*pdf''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
# launch web browser and open website with provided url
WebAutomation.LaunchEdge.LaunchEdge Url: $'''https://cityhospitaldemo.w3spaces.com''' WindowState: WebAutomation.BrowserWindowState.Maximized ClearCache: False ClearCookies: False WaitForPageToLoadTimeout: 60 Timeout: 60 PiPUserDataFolderMode: WebAutomation.PiPUserDataFolderModeEnum.AutomaticProfile BrowserInstance=> BrowserInstance
LOOP FOREACH CurrentItem IN Files
Pdf.ExtractTextFromPDF.ExtractText PDFFile: CurrentItem DetectLayout: False ExtractedText=> ExtractedPDFText
External.InvokeCloudConnector Connection: '' ConnectorId: '/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps' OperationId: 'PredictV2' @'item/requestv2/prompt': $'''Extract the below field information Invoice Number, Invoice Date(dd/mm/yyyy)
Customer Name,Customer Address, Item Description, Total Invoice Amount(remove the currecny symbol),Currency Symbol($ or €) from the below text and return all these information in JSON format and don\'t add any other parameters
%ExtractedPDFText%''' @PredictV2Response=> PredictV2Response @'responsev2/predictionOutput/text'=> PredictV2TextResponse
Display.ShowMessageDialog.ShowMessageWithTimeout Title: $'''info''' Message: PredictV2TextResponse Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False Timeout: 0 ButtonPressed=> ButtonPressed
Variables.ConvertJsonToCustomObject Json: PredictV2TextResponse CustomObject=> CustomObject
@@aiRecorder: 'True'
**REGION Launch web browser and open website with provided URL, fill in various form fields, and click the submit button
# fill in the 'Invoice Number' field with value 'Enter Invoice Number'
WebAutomation.PopulateTextField.PopulateTextField BrowserInstance: BrowserInstance Control: appmask['Web Page']['Input text \'invoiceNumber\''] Text: CustomObject['Invoice Number'] Mode: WebAutomation.PopulateTextMode.Replace EmulateTyping: True UnfocusAfterPopulate: True WaitForPageToLoadTimeout: 60
# fill in the 'Invoice Date' field with value 'dd/mm/yyyy'
WebAutomation.PopulateTextField.PopulateTextField BrowserInstance: BrowserInstance Control: appmask['Web Page']['Input text \'invoiceDate\''] Text: CustomObject['Invoice Date'] Mode: WebAutomation.PopulateTextMode.Replace EmulateTyping: True UnfocusAfterPopulate: True WaitForPageToLoadTimeout: 60
# fill in the 'Customer Name' field with value 'Enter Customer Name'
WebAutomation.PopulateTextField.PopulateTextField BrowserInstance: BrowserInstance Control: appmask['Web Page']['Input text \'customerName\''] Text: CustomObject['Customer Name'] Mode: WebAutomation.PopulateTextMode.Replace EmulateTyping: True UnfocusAfterPopulate: True WaitForPageToLoadTimeout: 60
# fill in the 'Customer Address' field with value 'Enter Customer Address'
WebAutomation.PopulateTextField.PopulateTextField BrowserInstance: BrowserInstance Control: appmask['Web Page']['Input text \'customerAddress\''] Text: CustomObject['Customer Address'] Mode: WebAutomation.PopulateTextMode.Replace EmulateTyping: True UnfocusAfterPopulate: True WaitForPageToLoadTimeout: 60
# fill in the 'Item Description' field with value 'Enter Item Description'
WebAutomation.PopulateTextField.PopulateTextField BrowserInstance: BrowserInstance Control: appmask['Web Page']['Input text \'itemDescription\''] Text: CustomObject['Item Description'] Mode: WebAutomation.PopulateTextMode.Replace EmulateTyping: True UnfocusAfterPopulate: True WaitForPageToLoadTimeout: 60
# fill in the 'Currency Symbol' field with value 'Enter Currency Symbol'
WebAutomation.PopulateTextField.PopulateTextField BrowserInstance: BrowserInstance Control: appmask['Web Page']['Input text \'currencySymbol\''] Text: CustomObject['Currency Symbol'] Mode: WebAutomation.PopulateTextMode.Replace EmulateTyping: True UnfocusAfterPopulate: True WaitForPageToLoadTimeout: 60
# fill in the 'Invoice Total' field with value 'Enter Invoice Total'
WebAutomation.PopulateTextField.PopulateTextFieldUsePhysicalKeyboard BrowserInstance: BrowserInstance Control: appmask['Web Page']['Input number \'invoiceTotal\''] Text: CustomObject['Total Invoice Amount'] Mode: WebAutomation.PopulateTextMode.Replace UnfocusAfterPopulate: True WaitForPageToLoadTimeout: 60
# click the 'Submit' button
@@aiRecorder: 'True'
WebAutomation.Click.Click BrowserInstance: BrowserInstance Control: appmask['Web Page']['Input submit \'Submit\''] ClickType: WebAutomation.ClickType.LeftClick MouseClick: True MousePositionRelativeToElement: WebAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0
END
External.Placeholder Category: 'AIDisclaimer' Message: 'Start of AI generated actions'
@@aiRecorder: 'True'
**ENDREGION
External.Placeholder Category: 'AIDisclaimer' Message: 'End of AI generated actions'
# [ControlRepository][PowerAutomateDesktop]
{
"ControlRepositorySymbols": [
{
"IgnoreImagesOnSerialization": false,
"Repository": "{\r\n \"Screens\": [\r\n {\r\n \"Controls\": [\r\n {\r\n \"AutomationProtocol\": \"uia3\",\r\n \"ScreenShot\": null,\r\n \"ElementTypeName\": \"Input text\",\r\n \"InstanceId\": \"15ec95de-3532-4818-a2f1-014bafa8a506\",\r\n \"Name\": \"Input text 'invoiceNumber'\",\r\n \"SelectorCount\": 1,\r\n \"Selectors\": [\r\n {\r\n \"CustomSelector\": \"html > body > div:eq(2) > div:eq(1) > form > input:eq(0)\",\r\n \"Elements\": [],\r\n \"Ignore\": false,\r\n \"ImageSelector\": null,\r\n \"IsCustom\": true,\r\n \"IsImageBased\": false,\r\n \"IsWindowsInstance\": false,\r\n \"Name\": \"Default Selector\",\r\n \"Properties\": []\r\n }\r\n ],\r\n \"Tag\": \"input\",\r\n \"ScreenshotPath\": \"controlRepo-screenshots\\\\b2988d5c-20f2-4360-876a-4f72c92d8485.png\"\r\n },\r\n {\r\n \"AutomationProtocol\": \"uia3\",\r\n \"ScreenShot\": null,\r\n \"ElementTypeName\": \"Input text\",\r\n \"InstanceId\": \"930e248c-5409-4dad-8965-72b03a19b1dc\",\r\n \"Name\": \"Input text 'invoiceDate'\",\r\n \"SelectorCount\": 1,\r\n \"Selectors\": [\r\n {\r\n \"CustomSelector\": \"html > body > div:eq(2) > div:eq(1) > form > input:eq(1)\",\r\n \"Elements\": [],\r\n \"Ignore\": false,\r\n \"ImageSelector\": null,\r\n \"IsCustom\": true,\r\n \"IsImageBased\": false,\r\n \"IsWindowsInstance\": false,\r\n \"Name\": \"Default Selector\",\r\n \"Properties\": []\r\n }\r\n ],\r\n \"Tag\": \"input\",\r\n \"ScreenshotPath\": \"controlRepo-screenshots\\\\6959e66d-f286-4008-a61a-87aa7cb97ea0.png\"\r\n },\r\n {\r\n \"AutomationProtocol\": \"uia3\",\r\n \"ScreenShot\": null,\r\n \"ElementTypeName\": \"Input text\",\r\n \"InstanceId\": \"08b833a7-a62d-4b01-afea-4b2d5a1eb59d\",\r\n \"Name\": \"Input text 'customerName'\",\r\n \"SelectorCount\": 1,\r\n \"Selectors\": [\r\n {\r\n \"CustomSelector\": \"html > body > div:eq(2) > div:eq(1) > form > input:eq(2)\",\r\n \"Elements\": [],\r\n \"Ignore\": false,\r\n \"ImageSelector\": null,\r\n \"IsCustom\": true,\r\n \"IsImageBased\": false,\r\n \"IsWindowsInstance\": false,\r\n \"Name\": \"Default Selector\",\r\n \"Properties\": []\r\n }\r\n ],\r\n \"Tag\": \"input\",\r\n \"ScreenshotPath\": \"controlRepo-screenshots\\\\fef6df8d-1048-4545-8676-dace387603ef.png\"\r\n },\r\n {\r\n \"AutomationProtocol\": \"uia3\",\r\n \"ScreenShot\": null,\r\n \"ElementTypeName\": \"Input text\",\r\n \"InstanceId\": \"9ca158d7-47d0-49eb-a767-774789f6d0a8\",\r\n \"Name\": \"Input text 'customerAddress'\",\r\n \"SelectorCount\": 1,\r\n \"Selectors\": [\r\n {\r\n \"CustomSelector\": \"html > body > div:eq(2) > div:eq(1) > form > input:eq(3)\",\r\n \"Elements\": [],\r\n \"Ignore\": false,\r\n \"ImageSelector\": null,\r\n \"IsCustom\": true,\r\n \"IsImageBased\": false,\r\n \"IsWindowsInstance\": false,\r\n \"Name\": \"Default Selector\",\r\n \"Properties\": []\r\n }\r\n ],\r\n \"Tag\": \"input\",\r\n \"ScreenshotPath\": \"controlRepo-screenshots\\\\151ae06e-84b8-413c-b8a6-c2a705414ce2.png\"\r\n },\r\n {\r\n \"AutomationProtocol\": \"uia3\",\r\n \"ScreenShot\": null,\r\n \"ElementTypeName\": \"Input text\",\r\n \"InstanceId\": \"e87af8f0-eb51-4c88-ba34-d7e63aefd6f1\",\r\n \"Name\": \"Input text 'itemDescription'\",\r\n \"SelectorCount\": 1,\r\n \"Selectors\": [\r\n {\r\n \"CustomSelector\": \"html > body > div:eq(2) > div:eq(1) > form > input:eq(4)\",\r\n \"Elements\": [],\r\n \"Ignore\": false,\r\n \"ImageSelector\": null,\r\n \"IsCustom\": true,\r\n \"IsImageBased\": false,\r\n \"IsWindowsInstance\": false,\r\n \"Name\": \"Default Selector\",\r\n \"Properties\": []\r\n }\r\n ],\r\n \"Tag\": \"input\",\r\n \"ScreenshotPath\": \"controlRepo-screenshots\\\\457c6633-523b-4c8b-8af3-fc7a87b7025a.png\"\r\n },\r\n {\r\n \"AutomationProtocol\": \"uia3\",\r\n \"ScreenShot\": null,\r\n \"ElementTypeName\": \"Input text\",\r\n \"InstanceId\": \"58a7e7c2-65c6-4f48-8ef8-2bbe320909a3\",\r\n \"Name\": \"Input text 'currencySymbol'\",\r\n \"SelectorCount\": 1,\r\n \"Selectors\": [\r\n {\r\n \"CustomSelector\": \"html > body > div:eq(2) > div:eq(1) > form > input:eq(5)\",\r\n \"Elements\": [],\r\n \"Ignore\": false,\r\n \"ImageSelector\": null,\r\n \"IsCustom\": true,\r\n \"IsImageBased\": false,\r\n \"IsWindowsInstance\": false,\r\n \"Name\": \"Default Selector\",\r\n \"Properties\": []\r\n }\r\n ],\r\n \"Tag\": \"input\",\r\n \"ScreenshotPath\": \"controlRepo-screenshots\\\\06d1ae85-b0ee-44ca-bd30-9a76dd6e7c0f.png\"\r\n },\r\n {\r\n \"AutomationProtocol\": \"uia3\",\r\n \"ScreenShot\": null,\r\n \"ElementTypeName\": \"Input number\",\r\n \"InstanceId\": \"c61e5fe4-bc97-4e32-a691-88c909a3f2f4\",\r\n \"Name\": \"Input number 'invoiceTotal'\",\r\n \"SelectorCount\": 1,\r\n \"Selectors\": [\r\n {\r\n \"CustomSelector\": \"html > body > div:eq(2) > div:eq(1) > form > input:eq(6)\",\r\n \"Elements\": [],\r\n \"Ignore\": false,\r\n \"ImageSelector\": null,\r\n \"IsCustom\": true,\r\n \"IsImageBased\": false,\r\n \"IsWindowsInstance\": false,\r\n \"Name\": \"Default Selector\",\r\n \"Properties\": []\r\n }\r\n ],\r\n \"Tag\": \"input\",\r\n \"ScreenshotPath\": \"controlRepo-screenshots\\\\597a96c8-3f39-4645-8d0a-2460859baa7c.png\"\r\n },\r\n {\r\n \"AutomationProtocol\": \"uia3\",\r\n \"ScreenShot\": null,\r\n \"ElementTypeName\": \"Input submit\",\r\n \"InstanceId\": \"e1550a29-8c2a-4fdc-a585-d01141a1734c\",\r\n \"Name\": \"Input submit 'Submit'\",\r\n \"SelectorCount\": 1,\r\n \"Selectors\": [\r\n {\r\n \"CustomSelector\": \"html > body > div:eq(2) > div:eq(1) > form > input:eq(7)\",\r\n \"Elements\": [],\r\n \"Ignore\": false,\r\n \"ImageSelector\": null,\r\n \"IsCustom\": true,\r\n \"IsImageBased\": false,\r\n \"IsWindowsInstance\": false,\r\n \"Name\": \"Default Selector\",\r\n \"Properties\": []\r\n }\r\n ],\r\n \"Tag\": \"input\",\r\n \"ScreenshotPath\": \"controlRepo-screenshots\\\\51d552e6-a1b4-4338-a9b8-33f0b3de9cba.png\"\r\n }\r\n ],\r\n \"Handle\": {\r\n \"value\": 0\r\n },\r\n \"ProcessName\": null,\r\n \"ScreenShot\": null,\r\n \"ElementTypeName\": \"Web Page\",\r\n \"InstanceId\": \"3acc3df0-2f83-41ec-85d6-9479d17860a4\",\r\n \"Name\": \"Web Page\",\r\n \"SelectorCount\": 1,\r\n \"Selectors\": [\r\n {\r\n \"CustomSelector\": null,\r\n \"Elements\": [\r\n {\r\n \"Attributes\": [],\r\n \"CustomValue\": null,\r\n \"Ignore\": false,\r\n \"Name\": \"Default Selector\",\r\n \"Tag\": \"domcontainer\"\r\n }\r\n ],\r\n \"Ignore\": false,\r\n \"ImageSelector\": null,\r\n \"IsCustom\": false,\r\n \"IsImageBased\": false,\r\n \"IsWindowsInstance\": false,\r\n \"Name\": \"Default Selector\",\r\n \"Properties\": []\r\n }\r\n ],\r\n \"Tag\": \"domcontainer\",\r\n \"ScreenshotPath\": \"controlRepo-screenshots\\\\03af45c7-e24e-42f2-86fa-24e3fcf0cd97.png\"\r\n }\r\n ],\r\n \"Version\": 1\r\n}",
"ImportMetadata": {
"DisplayName": "Local computer",
"ConnectionString": "",
"Type": "Local",
"DesktopType": "local"
},
"Name": "appmask"
}
],
"ImageRepositorySymbol": {
"Repository": "{\r\n \"Folders\": [],\r\n \"Images\": [],\r\n \"Version\": 1\r\n}",
"ImportMetadata": {},
"Name": "imgrepo"
},
"ConnectionReferences": []
}