cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Number Condition - keeps saying its false if number is higher than 10.

Hey all, 

 

im currently building a flow which compares 2 numbers in a condition.

 

  • String_CustomID is less than String_AvailableSeats

Condition.PNG

 

 

 

 

 

 

The flow itself works perfectly if the number is below 10, but if the number is higher than 10 it ignores the "0" and only uses the "1". Same goes for;

20 = 2

30 = 3

...

 

Var_customid.PNGVar_av-seats.PNGCondition_false.PNG

I don't know if it matters, but here's the value both strings are using to get the numbers;

 

  • CustomID
    • json(string(first(body('Filter_array_list'))))?['CustomID']

  • AvailableSeats
    • json(string(first(body('Filter_array_Trainings'))))?['Verf_x00fc_gbarePl_x00e4_tze']

I would really appreciate if anyone can help me resolving this problem.

 

Regards,

Snohx

1 ACCEPTED SOLUTION

Accepted Solutions

Try to use 

less(json(string(first(body('Filter_array_list'))))?['CustomID'],json(string(first(body('Filter_array_Trainings'))))?['Verf_x00fc_gbarePl_x00e4_tze'])  is equal to true 

in comparison.

View solution in original post

4 REPLIES 4
Super User III
Super User III

If you look at the run history are you sure that both digits of the number are in the JSON source? 

I can confirm that bot digits are indeed in the JSON source.

Output SharePoint:

SPO_Output.PNG

Input filter array:

fa ap input.PNG

Output filter array:

faf ap.PNG

 

Output SharePoint:

CustomID.PNG

Output filter array:

fa customid.PNG

Try to use 

less(json(string(first(body('Filter_array_list'))))?['CustomID'],json(string(first(body('Filter_array_Trainings'))))?['Verf_x00fc_gbarePl_x00e4_tze'])  is equal to true 

in comparison.

View solution in original post

I'm not sure if it matters in your case, but one thing I notice is that the numbers for your comparison are stored in strings. Why don't you try adding a "Parse JSON" step and providing it a sample so it can build a schema. You can then examine the output of the Parse JSON step to examine the values at that point. That might give you a clue how to proceed.

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (8,035)