> For the complete documentation index, see [llms.txt](https://docs.powerdevbox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.powerdevbox.com/autoreview/autoreview-power-platform-connector/file-v2.md).

# File (v2)

{% hint style="info" %}
A fully working flow can be found here&#x20;

<https://powerdevbox.com/assets/AutoReviewDemo_2_0_0_1.zip>
{% endhint %}

### Inputs (required)

<figure><img src="https://587669603-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lWqApvE0FgYB0xwkqLD%2Fuploads%2F4lD7NFrJBaBljdtqXtiP%2Fimage.png?alt=media&amp;token=4b227f18-1bfe-4aed-9bb1-d2479e2c86ec" alt="" width="563"><figcaption></figcaption></figure>

#### Display Name

Display name of the flow

#### Flow ID

Unique ID of the flow, recommend using Resource id or workflowid

#### Owner

Flow owner/maker

#### Environment

Environment name

#### Definition

Flow definition/clientData

### Inputs Optional

AutoReview allows configuration of the review metrics,  if left blank the review will follow the default values.

<figure><img src="https://587669603-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lWqApvE0FgYB0xwkqLD%2Fuploads%2F0u7zev6nh8USpaaTVcwO%2Fimage.png?alt=media&amp;token=37346c49-1a51-46a8-b5ca-8ae64dc2703e" alt="" width="563"><figcaption></figcaption></figure>

* [Complexity](/autoreview/configs/complexity.md)
* [Naming Convention](/autoreview/configs/naming-convention.md)
* [Ratings](/autoreview/configs/ratings.md)
* [Scoring](/autoreview/configs/scoring.md)

#### Complexity

New complexity items can be added with the 'Add new item' button. Though we recommend using the text mode (small pen in top right corner).

<figure><img src="https://587669603-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lWqApvE0FgYB0xwkqLD%2Fuploads%2FB4pjrGgcm0KHBjPdkiWy%2Fimage.png?alt=media&amp;token=a7c72d2a-111e-43a2-bd28-7ba172ce0869" alt="" width="185"><figcaption><p>Use text mode for easier editing</p></figcaption></figure>

The [complexity json](/autoreview/configs/complexity/complexity-template.md) object can then be edited in a source code editor (like Visual Studio Code or Notepad++) and then pasted in its entirety into the aComplexityTemplate input. With the reference inputted to the Reference Complexity.

<figure><img src="https://587669603-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lWqApvE0FgYB0xwkqLD%2Fuploads%2FZjcXyMzo19NgNZx5Cgbz%2Fimage.png?alt=media&amp;token=f1ead1b2-4583-467b-894b-947de5940500" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://587669603-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lWqApvE0FgYB0xwkqLD%2Fuploads%2FDlxjfb3gEgyPgO5MtMt4%2Fimage.png?alt=media&amp;token=4bf63706-ccb1-43ac-bb6f-c01553b6a9c3" alt="" width="563"><figcaption></figcaption></figure>

#### Naming Convention

The [naming convention json](/autoreview/configs/naming-convention/naming-template.md) has to be placed in 2 inputs.

<figure><img src="https://587669603-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lWqApvE0FgYB0xwkqLD%2Fuploads%2F0aHF6AfAjlWUmasJfyxc%2Fimage.png?alt=media&amp;token=74c383e8-48dc-4916-92ab-0bc5db3dc637" alt="" width="563"><figcaption></figcaption></figure>

* Naming Char - char
* Data - data array

#### Ratings

Each [rating key](/autoreview/configs/ratings/ratings-template.md) needs to be entered into the relevant inputs.

<figure><img src="https://587669603-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lWqApvE0FgYB0xwkqLD%2Fuploads%2FQjvCIqDshjasoXs61UM7%2Fimage.png?alt=media&amp;token=2a99254d-f7f0-439f-92ff-e8ef77a84a22" alt=""><figcaption></figcaption></figure>

#### Scoring

The [scoring json](/autoreview/configs/scoring/scoring-template.md) follows same pattern as complexity, with the reference input separately from the aScoringTemplate array.

<figure><img src="https://587669603-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lWqApvE0FgYB0xwkqLD%2Fuploads%2FmJGHnhh97SXMaJCYny8X%2Fimage.png?alt=media&amp;token=e0857d00-31d0-4b68-9ed4-e10a64e212d0" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://587669603-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lWqApvE0FgYB0xwkqLD%2Fuploads%2FzQ9K5bcCEKj1KeH15trB%2Fimage.png?alt=media&amp;token=00f1d51b-f995-4dba-8d1b-c08a03a44c86" alt="" width="563"><figcaption></figcaption></figure>

### Outputs

The File api returns the following

* Data/File
* Data/Info

#### File

The file key returns a HTML pile that can be used to create a file. There are 4 different file types:

* [Review](/autoreview/files/review.md)
* [Report](/autoreview/files/report.md)
* [Diagram](/autoreview/files/diagram.md)
* [Exceptions](/autoreview/files/exceptions.md)

#### Info

Data is a stringified json and once parsed returns different values depending on the file selected.

#### Review and Report

| Key          | Description                                  | Example |
| ------------ | -------------------------------------------- | ------- |
| Complexity\* | Complexity score                             | 100     |
| Actions      | Count of all actions                         | 40      |
| Variables    | Count of variables                           | 4       |
| Exceptions   | Count of exception actions (runAfter Failed) | 2       |
| Connections  | Count of connections                         | 2       |
| Premium      | Uses premium actions                         | true    |

*\*Review only*

#### **Diagram**

Returns the [nomnoml](https://www.nomnoml.com/#) file. This file is similar to mermaid and creates a text file that is rendered as a diagram. The text can be pasted into nomnoml site or a site using the library.

```
#fillArrows: true
#lineWidth: 2
#fill:#569AE5
#background: white
#acyclicer: greedy
#ranker: tight-tree
#.data: visual=database fill=#EBDAF9
#.trigger: visual=roundrect fill=#569AE5
#.if: visual=rhomb fill=#2596be
#.switch: visual=ellipse fill=#2596be
#.scope: visual=frame fill=#808080
#.foreach: visual=transceiver fill=#00C1A0
#.until: visual=sender fill=#00C1A0
#.var: visual=input fill=#9925be
#.terminate: visual=receiver fill=#cc4747
#.var: visual=input fill=#EBDAF9

[<trigger> *Recurrence]->[HTTP]
[<foreach>Apply_to_each]--:>[<terminate>Terminate]
[HTTP]->[<data>Parse_JSON]
[<data>Parse_JSON]->[<foreach>Apply_to_each]
```

<figure><img src="https://587669603-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4lWqApvE0FgYB0xwkqLD%2Fuploads%2F1KuTg1U5UEUbaaUf19XT%2Fimage.png?alt=media&amp;token=a6c072c8-134f-4b4f-b120-568e6aadb18b" alt=""><figcaption></figcaption></figure>

***

**Next Steps - Diagram**

{% content-ref url="/pages/Mn4xb2QVB9dJQ8QDg7Nt" %}
[Diagam (v2)](/autoreview/autoreview-power-platform-connector/diagam-v2.md)
{% endcontent-ref %}

**Next Steps - Files**

{% content-ref url="/pages/ZnzdkL0SHmklyEQvCxcP" %}
[Files](/autoreview/files.md)
{% endcontent-ref %}
