cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chrisosullivan
Level: Powered On

help with filtering data with less than

Hi All,

I've been creating a flow where it pulls data from SFDC, specifically Case Milestone data, in that data, there's a field which contains minutes:seconds in the format of xx:xx when I add a clause to fire a team's post the "less than clause" is ignored.

 

The flow looks like this:

  • Recurrence
    • interval = 30
    • frequency = minute
  • Initialize Today
    • Name = Today
    • Type = String
    • Value = formatDateTime(utcNow(), 'yyyy-MM-ddThh:mm;SSZ')
  • Get Milestone Data (Salesforce get records)
    • Salesforce Object Type = Case Milestones
    • Filter Query = TargetDate gt FX(addDays(utcNow(),-1)
    • Order by = blank
    • Top count = blank
    • Skip count = blank
    • Select Query = TargetDate,TimeRemainingInMins
  • Apply to each
    • Condition
      • Time Remaining In Mins is less than or equal to = 30:00
  • If yes
    • Teams post a message V3
  • If no
    • blank

What happens is the post goes out but for records where the seconds are over 30:00 (for example) so the less than clause appears to be ignored heres a screenshot:

step-1-3Step-4-5

 

I appreciate any guidance and help on this.

5 REPLIES 5
Dual Super User
Dual Super User

Re: help with filtering data with less than

Hi @chrisosullivan 

 

Time Remaining In Mins is less than or equal to = 30:00

 

30:00 is a string type in your case so less than or equal wont work

 

You will have to add additional logic which will require expressions

 

int(split(item()?['TimeRemainingInMinutes'],':')?[0]) 

is less than or equal to 30

 

 

Capture.PNGCapture1.PNG

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

 

Dual Super User
Dual Super User

Re: help with filtering data with less than

Hi @chrisosullivan 

 

Can you confirm what is the data being returned in the time remaining field? if it is just an integer as 30 then you need to modify the condition over there and enter 30. If it is being returned as a time string then it needs to be formatted using the format date time function in the expression editor. 

 

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!

chrisosullivan
Level: Powered On

Re: help with filtering data with less than

@RezaDorrani here is the error i get when i implement your suggestion:

 

Unable to process template language expressions for action 'Condition' at line '1' and column '2653': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#split for usage details.'.

 

@yashag2255 

hopefully the error above indicates this? not entirely sure how to read this.

Dual Super User
Dual Super User

Re: help with filtering data with less than

@chrisosullivan 

 

Is RemainingTimeInMinutes a mandatory field?

 

Because it seems some data is null for this field

chrisosullivan
Level: Powered On

Re: help with filtering data with less than

its the only field which counts down to 00:00 which indicated a breach of SLA we do have CreatedDate (time of case creation) and TargetDate (when SLA is due to expire if not satisfied) both fields are date/time dd/mm/yyyyThh:mm:ss

 

not sure if there's an alternative approach for this 

 

again appreciate you assisting here 

Helpful resources

Announcements
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 Kudoed Authors (Last 30 Days)
Users online (6,129)