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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Office Script If state...
Power Automate
Unanswered

Office Script If statement

(0) ShareShare
ReportReport
Posted on by 38

Can Office Script read the contents of the script as it's being populated, and make decisions based on that?

In other words, I know it's reading the dynamic content coming from Power BI and inserting the contents in the correct boxes, but can it read what's in the boxes?

 

I need the script to run one set of dynamic content if the property is an apartment, condo, mobile home, senior home, student housing, or townhouse.  If it's any other kind of property, I need it to run the commercial script.  

 

At the beginning of my flow, I have defined a variable for Property Type:

"PROPERTY_TYPEstring"
 
So now do I declare my 6 types of multifamilies as variables?  I've declared them, but when I go to write my if statement, it's underlining them in red.
 
bonjourposte_0-1684171536599.png

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @bonjourposte ,

     

    Please declare variables with 'let'.

     

    function main(workbook: ExcelScript.Workbook) {
        // Your code here
        let PROPERTY_TYPE:String
        let APARTMENT:String
        let CONDO:String
        let MOBIL:String

     

        if (PROPERTY_TYPE = APARTMENT){
            CONDO
        } else { MOBIL}
    }
     
    Best Regards,
    Bof
  • bonjourposte Profile Picture
    38 on at

    Thanks, it took me forever to get back to this project.  Thanks a bunch!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard