cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Wackmack88
Level 8

Condition between two number values

Hi, 

 

I'm building a flow with three conditions. The first and last are fine but my middle condition wont load. Here are the conditions:

 

0-100, first condition

101-1000, second condition

1001, thrid condition

 

The first condition is less then 100, this works fine.
@and(greaterOrEquals(triggerBody()?['Numbercolumn'], '101'),lessOrEquals(triggerBody()?['Numbercolumn'],'1000'))
The last condition is greater then 1000, this works fine.

 

I cant save the expresion, does someone sees what is the mistake here?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Condition between two number values

Hi @Wackmack88 ,

 

I agree with what @edgonzales  suggested.

 

When comparing numbers, we don’t need to surround the number with a single quote. Besides, we should provide matched types within an expression.

 

I have tested likes below, which is working properly.

 

The function used in the left side of the condition is:

and(greaterorequals(triggerBody()['Number'],100),lessOrEquals(triggerBody()['Number'],1001))

1.PNG

 

Besides, you mentioned that you cannot save the expression, what’s the error message returned when you try saving?

 

Best regards,

Mabel        

  

Community Support Team _ Mabel Mao
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

5 REPLIES 5
Dual Super User
Dual Super User

Re: Condition between two number values

Hi @Wackmack88 

 

Please see the screenshot below: 

ldjl.png

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Super User
Super User

Re: Condition between two number values

@Wackmack88 

Hi there.  I'm not great with expressions, but I messed around a bit and got this to work in the expressions box:

 

and(greaterOrEquals(triggerBody()['number'],101),lessOrEquals(triggerBody()['number'],1000))
 
Since you're dealing with integers, it might not like the single quotes around the values?
Try it out and less us know.
-Ed-
 

If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Community Support Team
Community Support Team

Re: Condition between two number values

Hi @Wackmack88 ,

 

I agree with what @edgonzales  suggested.

 

When comparing numbers, we don’t need to surround the number with a single quote. Besides, we should provide matched types within an expression.

 

I have tested likes below, which is working properly.

 

The function used in the left side of the condition is:

and(greaterorequals(triggerBody()['Number'],100),lessOrEquals(triggerBody()['Number'],1001))

1.PNG

 

Besides, you mentioned that you cannot save the expression, what’s the error message returned when you try saving?

 

Best regards,

Mabel        

  

Community Support Team _ Mabel Mao
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

Wackmack88
Level 8

Re: Condition between two number values

Hi,

 

First, thank you for your time and examples, they look very well. When i test the flow with the trigger, the output is not right. See my examples, i start with the value 1500 but the flows output is less then 100, that doenst seems right. 

I just copied the flow. In the last picture, i put the numbercolumn there, i think i have to check the number with the SharePoint information. This is the proces.

List in SP
3 sorts of value, it is not a choice column because people has to choose every number the want to choose.

0-100 range = workflow 1

101-1000 range = workflow 2 

1000+ range = workflow 3

 

For every range i will send a different email. Hope everything is clear to you.Flow2.pngFlow.pngFlow3.png

Wackmack88
Level 8

Re: Condition between two number values

@v-yamao-msft  your expressions works fine! So i can fill in the number between 101-1000 and it works fine. Now i need to clean up the flow and convert it with my number column. So when someone fill in the value in the SharePoint list, the right flow needs te run.

 

Thanks all for your help. Because of you and the help of the forums i will keep better in Flow 🙂Flow7.pngFlow6.pngFlow5.png

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,388)