cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alexyoy111
Helper II
Helper II

Creating a complex flow with summaries DYNAMICS 365

Hello,

 

To the next task  I do not know if it can be done through flow (Power Automate).

 

On our Dynamics 365 we have daily API which create records from third Part Source. the record look as follow

 

tenantdateconsumption
101/01/20201
101/02/20202
201/03/20201
201/03/20201

 

Using Power Automate we would like   to summarize the consumption per tenant and every seven day if the total consumption is more than  7 send an email If it's less than 7 to ignore.

 

Can something like this be achieved by power automate?

 

🙂

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @alexyoy111 ,

 

I would share the solution on a sharepoint list:

1.png

you could refer to my solution to create the flow:

2.png3.png4.png5.png

Expression in the Filter Query:

addDays(utcNow(),-7)
addDays(utcNow(),-1)

Expression in the Compose 2:

union(variables('Name data'),array(outputs('Compose')))

 

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
ChristianAbata
Super User
Super User

Shure you can @alexyoy111  you need to use Filter Array to get just the values by tennant so then you can compare if some of that values are more than 7 then send email.

 

Or you can save your rows into a sharepoint list and then get the values from the sharepoint list to do the same compare.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
v-alzhan-msft
Community Support
Community Support

Hi @alexyoy111 ,

 

Could you share an example of the summarize email?

Do you want to check from the records for date on previous 7 days or each tenant, and count the total consumption for each tenant on the previous 7 days?

 

If yes, please share the entity and let me know, I would provide the steps to create the flow.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@v-alzhan-msft  thank you very much for your response. How would you like me to share the entity? do you need the list of field or a screenshot of the form?😊

@v-alzhan-msft  Maybe this example will help you more to understand my need 

 

Assuming this is the data I have and each record created automatically each night.

 

I would like to get an email alert when the total consumption in the last 7 days is higher than 7 (Which can indicate  to my team that maybe there is an issue with the water meter and  need to be investigated).

 

Obviously this alert can go on and on every day until the issue had been fixed and the conception is back to reasonable use

 

So in this example I would like to get an alert on 09/03/2020 saying "pay attention to tenant TN0416 thee conception is unreasonable"

 

The date format id DD/MM/YYYY

 

 

Name dataconsumptiondatemeter id
TN04160.1001/03/202018153873-W
TN04160.5002/03/202018153873-W
TN04160.3003/03/202018153873-W
TN04161.1004/03/202018153873-W
TN04161.2005/03/202018153873-W
TN04161.0006/03/202018153873-W
TN04161.0007/03/202018153831-W
TN04161.1008/03/202018153831-W
TN04161.0009/03/202018153831-W
TN04160.5010/03/202018153831-W
TN04160.3011/03/202018153831-W
TN04160.1012/03/202018153831-W
TN04160.8013/03/202018153831-W
TN04160.3014/03/202018153831-W
TN04160.7015/03/202018153951-W
TN04160.6016/03/202018153951-W
TN04160.1017/03/202018153951-W
TN04160.5018/03/202018153951-W
TN04160.3019/03/202018153951-W
TN04160.1020/03/202018153951-W
TN04160.8021/03/202018153951-W
TN04160.3022/03/202018153969-W
TN04160.7023/03/202018153973-W
TN04160.6024/03/202018153973-W
TN04160.5025/03/202018153973-W
TN04167.0026/03/202018153973-W
TN04160.1027/03/202018153973-W

Hi @alexyoy111 ,

 

So the flow would check from the items for the previous 7 days on?

In your example, the alert would be sent on 10/03/2020, and the records from 11/03/2020 to 27/03/2020 is not existed on 10/03/2020, right?

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-alzhan-msft  That's correct the records are not exist at that time. 

 

Obviously they will be create  on the next day but at the time of the alert they are not exist yet.

 

 

 

 

Hi @alexyoy111 ,

 

I would share the solution on a sharepoint list:

1.png

you could refer to my solution to create the flow:

2.png3.png4.png5.png

Expression in the Filter Query:

addDays(utcNow(),-7)
addDays(utcNow(),-1)

Expression in the Compose 2:

union(variables('Name data'),array(outputs('Compose')))

 

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,042)