Hi,
I'm probably missing something stupidly obvious here...
I'm working on a contract automation that pulls data from excel into a word template.
The working weeks section if blank should be 52.14 and then if not blank should display the value.
I currently have if(empty(item()?['Offer Letter - Working Weeks']),'52.14',int(item()?['Offer Letter - Working Weeks'])) but now every output has 52.14 regardless of the contents.
Help please!
I fixed this, for anyone interested the code tweak below worked:
Hi,
Thanks for this.
So it's already in Compose at the minute and the 'populate word document' pulls the result from the compose. Essentially because the spreadsheet comes from an outside source, i'm not able to incorporate a formula to output the value 52.14 if the cell is blank.
i.e. if row 1 shows '11' then input '11', but if row 1 shows null then input '52.14'
@Cfis To troubleshoot your expression, use a Compose action to store the expression that just checks to see whether or not the working weeks section is empty:
empty(item()?['Offer Letter - Working Weeks'])
If this expression alone isn't returning the results you are expecting, you'll need to adjust the expression until it outputs the result you are looking for.
Additionally, you can use another Compose action to output this expression:
int(item()?['Offer Letter - Working Weeks'])
Check to see if the output of this expression is what you are expecting. To troubleshoot an expression, break it out into separate parts.
You might find the tutorials linked below helpful:
7 Functions You Need to Know | ⚡️Expression Essentials: Part 1⚡️
In this section, I'll cover how to get dynamic content with an expression when the dynamic content you need isn't listed in the dynamic content menu.
In the full tutorial I cover 7 functions you need to know when getting started with expressions.
1️⃣ empty()
2️⃣ coalesce()
3️⃣ equals()
4️⃣ if()
5️⃣ concat()
6️⃣ length()
7️⃣ split()
I cover how to use these functions in expressions and I’ll also cover common mistakes when it comes to writing expressions and show you a few tips and tricks along the way.
As a beginner or even an intermediate flow builder—expressions can seem a bit complex at first, I’m going to try to simplify it for you. If you want to level up your flows by writing expressions—keep watching!
IN THIS VIDEO:
✅ What is an Expression?
✅ What is a Function?
✅ What Does Wrapping a Function Mean?
✅ How Do I Insert an Expression?
✅ How to Use a Compose action
✅ How to Navigate the Expression Builder with Arrow Keys
✅ How to use the Expression Tooltip
✅ Common Mistakes When Writing Expressions
✅ How to differentiate a null from an empty string
✅ How to Get Dynamic Content When it’s Not Listed
✅ How to Use a Get Item Action to Verify Dynamic Content Output
✅ How to Convert Strings to Lower Case
✅ How to Troubleshoot the if() Function
----
5 Power Automate Troubleshooting FAQs and Helpful Tips for Creating Better Flows
In this Power Automate tutorial, I explore 5 frequently asked questions that pop up when troubleshooting a flow. If you’d like to to level up your Power Automate flow skills and learn how to troubleshoot your Power Automate flow—this tutorial is for you!
IN THIS VIDEO:
✅ How to troubleshoot a false Condition action result
✅ How to get dynamic content when it isn’t selectable from the list of dynamic content
✅ How to troubleshoot an Apply to Each action that isn’t looping through
✅ How to troubleshoot a skipped Apply to Each action
✅ How to troubleshoot a Filter Query
✅ How to use a SharePoint yes/no column in a Filter Query
✅ How to use Compose actions to troubleshoot a Power Automate flow
✅ How to troubleshoot multiple emails being sent
✅ How to troubleshoot multiple Teams messages being sent
WarrenBelz
146,658
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional