Skip to main content

Flow approval attachments

Scenario 1:

I have a document library, User will upload the document to the document library, then it will trigger the MS flow, for approval.

Here the document has to be added as attachment for approval.

How to do,

Step: In PA, Instant flow

Step: "For selected file"

Start and wait for approval:

Approval type: Approve/Reject-First to respond

Title: Invoice approval for <FileName>

Assigned To: Koti

Attachments Name-1

Select <fileName>

Attachment Content-1:

In order to get attachment content,

Before- Add action name "Get file properties" and Select Site Address, Library Name, Id. This will give all the properties of the file.

Next, we need to add "Get file content" action. Pick site address and file identifier: Select Identifier. This will give actual content of the file in base 64 formate.

Now in "Start and wait for approval" action, attachment content-1: choose "File Content"

Step: Condition: Outcome is equal to Approve

Step: If Yes, Compose action: Approved

If No, Rejected

Click Save the flow as named: Invoice Approval.

Using the flow: Now go and upload the file in document library.

Select the power automate icon in ribbon and click on the Invoice Approval and click run.

Now the flow running status history.

now check email, email received with attachment.

now approver, In email can do action approve or reject.

-----------------

Scenario 2: 

Now SharePoint List. How to create a dynamic array in SharePoint List.

Means, For example in "Start and wait for approval" action, I have attachment section as Attachment Name-1 and Attachment Content-1.
In case i have multiple files, then we need to make it dynamic array.

Step: Instant Flow
Step: When an item is created
Step: "Get attachments" action, select stie, list and Id. This gives all the attachments in SP List.
Step: "Get attachment content" action,
Site Address,List, Id,  File identifier: Choose from Get attachments action output ->Id

Automatically apply to each, beacuse it returns multiple attachments.

Step: Now we need to create a variable in above steps for creating array.

Add Initialize varaible: varAttachments of type Array.

In Apply to each action, add "Append to array variable" action.

Name: varAttachments

Value: frame the array as below with syntax.(JSON object)

[

 "name":<DispalyName from get attachments>,

 "content":<Attachment Content from get attachments>

]

add new step out side apply to each

Add "Start and wait for Approval"

Approval type: Approve/Reject- First to respond

Title: workflow task <Title>

Assigned To: Koti

Attachments Name-1 on right side T symbol represents switch action.

Attachements: This list of attachments. Now add from variable we created called" varAttachments"

Add Condition, Outcome is equal to Approve

if Yes, Compose Approved

if No, Compose action Rejected

Usage: Now go the list and add an item in SP list. the flow triggers.

In the form while filling, add multiple attachments as pdf, jpg, word file etc.. the click save.

Now in flow running action history chek.

In email, you see 3 attachments with approval/.reject button response.

---------------------------------

Scenario 3:

Microsoft Forms.

In Microsoft forms, files will be saved in onedrive.
------------------------------------------------------

Instant flow, 

"When a new response is submitted."

"Get response detail" action choose form id and reponse id from response action 

Save the form.

---------------------

Limitations

CDS, max file size limit is 5MB, it can be changed by admin.
Approval connector attachment size limits to 50MB, and this limit cannot be changed.
Approval email attachment max size is 5MB. if it more than then message appears in email as "This email contains attachments for approval are too big". So approver cannot see those attachments.



Comments

Popular posts from this blog

Powerapps overcome 2000 item limit from any datasource

First go through delegation concept https://tejasadventure.blogspot.com/2020/05/power-apps-understanding.html In powerapps, we observe by default 500 item limit has set with in the app level for any data source. In order to overcome, we have option to set the limit of 2000 item limit maximum in the app. Now using code, MaximoFacility is my data source name contains 3000 items. ColFacilityDropdown is the collection storing the count of items from data source. We expect to see more than 2000 items. Based on StartWith function filtering the data with respective to the charectors and numbers as mentioned below. Code: Place the below code in a button on select property. Add label with code CountRows(ColFacilityDropdown) ClearCollect(ColFacilityDropdown,Filter(Filter(MaximoFacility, Status = "ACTIVE"), StartsWith( Title, "A" ))); Collect(ColFacilityDropdown,Filter(Filter(MaximoFacility, Status = "ACTIVE"), StartsWith( Title, "B" ))); Collect(ColFacilit...

Power Apps Understanding

https://tejasadventure.blogspot.com/2019/10/power-apps-we-have-1.html https://tejasadventure.blogspot.com/2019/11/power-apps-how-to-configure-using-blank.html   https://tejasadventure.blogspot.com/2019/11/power-apps-field-controls.html Report We can use people picker fields, look up fields  file attachment back next save cancel download the report and this report can be used in other system of powerapp. Add new report button - asks add from existing report Report all item view can design in the way like sharepoint list views for example. we can group it Group AND or Group OR by apply filters Canvas apps: Arrange user experience and interface design allow creativity and business use case guide how the way app wants to look like. Sources can be around 200+ ways. Majorly SharePOint, Power BI From data, From Sample From CDS From blank canvas via appSource Model driven apps: Model driven apps uses power of CDS rapidly to configure your for...

PowerApps multiselect cascading dropdown and save an item to SharePoint List

 I have one scenario as below List 1: Division List has title field List 2: District List has Title and Division Field(LookUp from Division List) List 3: Facility List has Title, District Field(LookUp field from District List) List 4: County List has Title, Facility Field(LookUp field from Facility List) Main List: Spill Report is the main list  Division Field( Look up from Division List) District Field(Look up field from District List) Facility Field(Look up field from Facility List) County Field(Look up field from County List) List Screenshots provided below can be refered for clarification. ----------------------------------------------------------------------------------------------------- PowerApps Canvas Apps In Power Apps Canvas App, We need to first design the app with the 4 respective fields Since those fields are multiselect, then it is to combo box. Generally power apps are not supported for multiselect cascasding dropdown. Refere microsoft documentation, Know Limit...