> 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

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

### Inputs (required)

<figure><img src="https://615225135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRQ78yGt6X6zz3qONecCy%2Fuploads%2Fgit-blob-84ea6a01435a3a16daed0f404f0647bfe8813f64%2Fimage%20(228).png?alt=media" 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://615225135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRQ78yGt6X6zz3qONecCy%2Fuploads%2Fgit-blob-9d44daddcf92578dfb0a984e513893508bfb8b03%2Fimage%20(229).png?alt=media" 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://615225135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRQ78yGt6X6zz3qONecCy%2Fuploads%2Fgit-blob-af7e75373c6ed1ef09c53d7737be32832b906929%2Fimage%20(150).png?alt=media" 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://615225135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRQ78yGt6X6zz3qONecCy%2Fuploads%2Fgit-blob-105ad0f0678e11f8a3c089dc7a1a6a98f511f7a6%2Fimage%20(230).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://615225135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRQ78yGt6X6zz3qONecCy%2Fuploads%2Fgit-blob-e21016133289948e65bb431ee5a0fd154caa1535%2Fimage%20(231).png?alt=media" 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://615225135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRQ78yGt6X6zz3qONecCy%2Fuploads%2Fgit-blob-9d0bf9e49694466fc23b12c44157469458faa37d%2Fimage%20(232).png?alt=media" 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://615225135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRQ78yGt6X6zz3qONecCy%2Fuploads%2Fgit-blob-80621fe0c818df7e5eeda9f263ec75a90599daa3%2Fimage%20(235).png?alt=media" 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://615225135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRQ78yGt6X6zz3qONecCy%2Fuploads%2Fgit-blob-661b143f00985a69040e85255c4dbc85081755fe%2Fimage%20(236).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://615225135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRQ78yGt6X6zz3qONecCy%2Fuploads%2Fgit-blob-36b9bf45de3395e34ed1c7196c124f3023384fe4%2Fimage%20(237).png?alt=media" 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://615225135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRQ78yGt6X6zz3qONecCy%2Fuploads%2Fgit-blob-5e271de5f3244edea2c799bbbcf74858ef266523%2Fimage%20(157).png?alt=media" alt=""><figcaption></figcaption></figure>

***

**Next Steps - Diagram**

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

**Next Steps - Files**

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