web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

I need help understanding this power automate expression code

(0) ShareShare
ReportReport
Posted on by 8

Hi all, I appreciate your time and involvement in this community. Thank you.

 

I need some help understanding some code my boss wrote in power automate. He used this expression to set a Variable we are using to calculate a forecast.

 

if(
    equals(
        outputs('Get_Permit')?['body/osp_undergroundfootageplannedft'],
        null
    ),
    0,
    if(
        equals(
            mod(
                int(outputs('Get_Permit')?['body/osp_undergroundfootageplannedft']),
                5000
            ),
            0
        ),
        div(
            int(outputs('Get_Permit')?['body/osp_undergroundfootageplannedft']),
            5000
        ),
        add(
            int(
                div(
                    int(outputs('Get_Permit')?['body/osp_undergroundfootageplannedft']),
                    5000
                )
            ),
            1
        )
    )
)

I think the first part means "if the outputs are null then do nothing. 

I think the second part is converting to integer so the math operators are satisfied with their data type. After that I need the help. I think it means we are taking the footage outputs and dividing it by 5000 and considering the remainder. If the answer isn't zero then we take the footage and divide by 5000. Whatever that number is gets added to 1?  Man, that can't be right. I would really love someone to put this in plain english. 

-PowerPlatguy

I have the same question (0)
  • Power Platform Communities Profile Picture
    8 on at

    If the answer is zero then its divide by 5000 else add 1 to div by 5000. That's what that logic says. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 83

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 76 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 49

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans