Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort-Action error: The property 'ActionName' cannot be found on this object. #10

Open
acieslik opened this issue Aug 7, 2023 · 6 comments
Assignees

Comments

@acieslik
Copy link

acieslik commented Aug 7, 2023

When I try to process the attached logic app (json) I get the following error:

162 | Sort-Action -Actions $objects
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The property 'ActionName' cannot be found on this object. Verify that the property exists.

So something is going wrong in that function.

sort-action-bug-sample.zip

@stefanstranger
Copy link
Owner

Hi @acieslik looking at your flow I see the following when trying to determine the order of your actions.

image

Can you let me know which actions follows which actions?

/Stefan

@acieslik
Copy link
Author

acieslik commented Aug 8, 2023

Here is a screenshot on how the logic app looks in the designer...
2023-08-08 16_00_23-FlowChart
If "Initialize_success" runs successfull, both will run in parallel

  • "async_response" will run
  • "Close_Cost_Esltimation_service_invoice"
    Sample run:
    2023-08-08 16_00_23-FlowChart2

@stefanstranger
Copy link
Owner

stefanstranger commented Aug 9, 2023

I've now the following result.

PowerAutomate Flow Documentation - Notify of Canceled Meetings

Introduction

This document describes the PowerAutomate Flow Notify of Canceled Meetings in the 839eace6-59ab-4243-97ec-a5b8fcc104e4 Environment.

This document is programmatically generated using a PowerShell script.

Date: 2023-08-09 16:51:41

PowerAutomate Flow Diagram

graph TB
    manual
    subgraph Close_Cost_Estimation_service_invoke
    direction TB
        HTTP_Webhook
    end
    subgraph Condition-True
    direction TB
        Set_success
    end
    subgraph Service_Scheduler_service_invoke_failed
    direction TB
        update_process_failed
    end
    subgraph Service_Scheduler_service_invoke_succeeded
    direction TB
        Condition
        Parse_Service_Result
        update_process_succeeded
    end
    Initialize_success --> Close_Cost_Estimation_service_invoke
    Close_Cost_Estimation_service_invoke --> HTTP_Webhook
    Initialize_processid --> Get_apikey
    Get_apikey --> Initialize_apikey
    init_uri --> Initialize_processid
    Initialize_apikey --> Initialize_success
    Close_Cost_Estimation_service_invoke --> Service_Scheduler_service_invoke_failed
    Service_Scheduler_service_invoke_failed --> update_process_failed
    Service_Scheduler_service_invoke_failed --> Service_Scheduler_service_invoke_succeeded
    Parse_Service_Result --> Condition
    Condition --> Set_success
    Service_Scheduler_service_invoke_succeeded --> Parse_Service_Result
    Condition --> update_process_succeeded
    Initialize_success --> async_response
    manual --> init_uri

Loading

PowerAutomate Flow Actions

This section shows an overview of PowerAutomate Flow actions and their dependencies.

PowerAutomate Flow Triggers

Name Type Inputs
manual Request
{
"schema": {
"properties": {
"declineReason": {
"type": "integer"
},
"entityId": {
"type": "string"
},
"entityName": {
"type": "string"
},
"processId": {
"type": "string"
},
"statuscode": {
"type": "integer"
},
"userId": {
"type": "string"
}
},
"type": "object"
}
}

Actions

ActionName Type RunAfter Inputs
init_uri InitializeVariable
{
"variables": [
{
"name": "uri",
"type": "String",
"value": "https://mysapwebservice/call"
}
]
}
Initialize_processid InitializeVariable init_uri
{
"variables": [
{
"name": "processid",
"type": "String",
"value": "@triggerBody()?['processId']"
}
]
}
Get_apikey ApiConnection Initialize_processid
{
"host": {
"connection": {
"name": "@parameters('$connections')['keyvault']['connectionId']"
}
},
"method": "get",
"path": "/secrets/@{encodeURIComponent('mykey')}/value"
}
Initialize_apikey InitializeVariable Get_apikey
{
"variables": [
{
"name": "apikey",
"type": "string",
"value": "@body('Get_apikey')?['value']"
}
]
}
Initialize_success InitializeVariable Initialize_apikey
{
"variables": [
{
"name": "success",
"type": "string",
"value": "false"
}
]
}
Close_Cost_Estimation_service_invoke Scope Initialize_success null
HTTP_Webhook HttpWebhook Close_Cost_Estimation_service_invoke
{
"retryPolicy": {
"type": "none"
},
"subscribe": {
"body": {
"callbackUrl": "@{listCallbackUrl()}",
"declineReason": "@triggerBody()?['declineReason']",
"entityId": "@{triggerBody()?['entityId']}",
"entityName": "@{triggerBody()?['entityName']}",
"longRunningProcessId": "@{variables('processid')}",
"statuscode": "@triggerBody()?['statuscode']",
"userId": "@{triggerBody()?['userId']}"
},
"headers": {
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "@variables('apikey')"
},
"method": "POST",
"uri": "@variables('uri')"
},
"unsubscribe": {}
}
Service_Scheduler_service_invoke_failed Scope Close_Cost_Estimation_service_invoke null
update_process_failed ApiConnection Service_Scheduler_service_invoke_failed
{
"body": {
"xvrm_log": "{"LogicActionResults": [],"Success":false,"InformationMessage":"","ErrorMessage": "There was an error during processing.","ErrorStack":"","RunId": "@{workflow().run.name}"}",
"xvrm_processstatus": 135790003
},
"host": {
"connection": {
"name": "@parameters('$connections')['commondataservice_1']['connectionId']"
}
},
"method": "patch",
"path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('env.crm4'))}/tables/@{encodeURIComponent(encodeURIComponent('xvrm_longrunningprocesses'))}/items/@{encodeURIComponent(encodeURIComponent(variables('processid')))}",
"retryPolicy": {
"type": "none"
}
}
Service_Scheduler_service_invoke_succeeded Scope Service_Scheduler_service_invoke_failed null
Parse_Service_Result ParseJson Service_Scheduler_service_invoke_succeeded
{
"content": "@body('HTTP_Webhook')",
"schema": {
"properties": {
"ErrorMessage": {
"type": "string"
},
"ErrorStack": {
"type": "string"
},
"InformationMessage": {
"type": "string"
},
"LogicActionResults": {
"items": {
"properties": {
"Action": {
"type": "string"
},
"Message": {
"type": "string"
},
"Status": {
"type": "integer"
}
},
"type": "object"
},
"type": "array"
},
"Success": {
"type": "boolean"
}
},
"type": "object"
}
}
Condition If Parse_Service_Result null
Set_success SetVariable Condition-True
{
"name": "success",
"value": "true"
}
update_process_succeeded ApiConnection Service_Scheduler_service_invoke_succeeded
{
"body": {
"xvrm_processstatus": 135790002,
"xvrm_response": "{"LogicActionResults": @{body('Parse_Service_Result')?['LogicActionResults']},"Success":@{variables('success')},"InformationMessage":"@{body('Parse_Service_Result')?['InformationMessage']}","ErrorMessage": "@{body('Parse_Service_Result')?['ErrorMessage']}","ErrorStack":"@{body('Parse_Service_Result')?['ErrorStack']}","RunId": "@{workflow().run.name}"}"
},
"host": {
"connection": {
"name": "@parameters('$connections')['commondataservice_1']['connectionId']"
}
},
"method": "patch",
"path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('env.crm4'))}/tables/@{encodeURIComponent(encodeURIComponent('xvrm_longrunningprocesses'))}/items/@{encodeURIComponent(encodeURIComponent(variables('processid')))}",
"retryPolicy": {
"type": "none"
}
}
async_response Response Initialize_success
{
"body": {},
"schema": {
"properties": {},
"type": "object"
},
"statusCode": 200
}

PowerAutomate Flow Connections

This section shows an overview of PowerAutomate Flow connections.

@acieslik
Copy link
Author

acieslik commented Aug 9, 2023

Hi @stefanstranger,
it looks almost perfect, except that the "Service_Scheduler_service_invoke_succeeded" and Condition "True" box is not quite correctly displayed.
Here is the screenshot how it actually looks like in the logic app:
2023-08-08 16_00_23-FlowChart3

@stefanstranger
Copy link
Owner

The challenge I've is that when you look at the condition type in the json code there are no True and False actions.

image

So I'm creating for the true and false conditions a parent attribute.
image

So Set_Success action get a (new) parent Condition-True. And this is not a 'real' Action, so it does not have a Parent.

The logic to translate all the actions into a Mermaid diagram is pretty complicated. And one change can easily break working solutions.

@stefanstranger stefanstranger self-assigned this Aug 11, 2023
@acieslik
Copy link
Author

The mermaid output could be like this:

graph TB
    Trigger
    subgraph Close_Cost_Estimation_service_invoke
    direction TB
        HTTP_Webhook
    end

subgraph Service_Scheduler_service_invoke_failed
    direction TB
        update_process_failed
    end
    subgraph Service_Scheduler_service_invoke_succeeded
    direction TB
        Parse_Service_Result
        subgraph Condition
        direction TB
            subgraph True
            direction TB
                Set_success
            end
        end
        update_process_succeeded
    end
    Initialize_success --> Close_Cost_Estimation_service_invoke
    Close_Cost_Estimation_service_invoke --> HTTP_Webhook
    Initialize_processid --> Get_apikey
    Get_apikey --> Initialize_apikey
    init_uri --> Initialize_processid
    Initialize_apikey --> Initialize_success
    Close_Cost_Estimation_service_invoke --> Service_Scheduler_service_invoke_failed
    Service_Scheduler_service_invoke_failed --> update_process_failed
    Service_Scheduler_service_invoke_failed --> Service_Scheduler_service_invoke_succeeded
    Service_Scheduler_service_invoke_succeeded --> Parse_Service_Result
    Parse_Service_Result --> Condition
    Condition --> update_process_succeeded
    Initialize_success --> async_response
    Trigger --> init_uri

2023-08-29 13_39_32-mermdiag

I will further check how the mermaid code generation could be changed in order to receive the above diagram.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants