Power Automate: Difference between revisions

Jump to navigation Jump to search
1,559 bytes removed ,  1 December 2021
Line 67: Line 67:
}
}
</syntaxhighlight>
</syntaxhighlight>
==== Triggers ====
For now, the connector does not support triggers. However, there is a workaround available using the server process event and invoking an HTTP request provided by "When an HTTP request is received". Simply create a new automated cloud flow, name it, and click skip to create an empty flow. Search for "Request" connector and add the "When an HTTP request is received" trigger. Set "Request Body JSON Schema" to accept the ''id'' parameter:
<syntaxhighlight lang="json">
{
    "type": "object",
    "properties": {
        "id": {
            "type": "string"
        }
    }
}
</syntaxhighlight>
Under '''Show Advanced Options''' set method to '''POST'''. Save the flow to generate "HTTP POST URL".
[[File:Pa-flow.png|600px]]
Now you have to create a process to invoke trigger in your flow.
# Log into your [[Resco Cloud]] server, start the [[Admin Console]], and select '''Processes''' from the menu.
# Click '''New''', enter a name for the new process, select the desired entity (e.g., Account), and the desired event (e.g., Record is created).
# Add StringList variable '''headers''' and add item <code>Content-Type: application/json;charset=utf-8</code> to it.
# Add string variable '''body''' as "Format Text" with: <code>\{ "id": "{Entity.id}" \}</code>.
# Then, add the function step `Server.InvokeWebRequest` with `POST` method. URL copied from "When an HTTP request is received" trigger and body variable.
[[File:Resco-process.png|600px]]
Now, when you create a record of the specified entity type, the trigger activates.


=== Common errors and remedies ===
=== Common errors and remedies ===

Navigation menu