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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Salesforce Connector -...
Power Automate
Answered

Salesforce Connector - Disabling User Based On Date In Salesforce Resource

(0) ShareShare
ReportReport
Posted on by 9

Hi,

We're trying to put together a flow whereby once a day at the close of business it checks if the end date of the user matches todays date and if it does, then disable the account in azure AD.

I can see the part to update azure ad account to disabled, that's fine. The issue i'm having is filtering out the record from salesforce, then comparing the date to todays date and if it matches then action.

Can anyone help with filtering out what we need and then the best way to compare it to todays date please?

This is where we got to but it doesn't seem to pull the record we need when we check the raw data, so the filter below doesn't work.

EndDateFlow.JPG

I can provide the data output if required but I will have to go through it and remove any sensitive data.

Categories:
I have the same question (0)
  • v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @Alex_Noble 

     

    1. You can use the formatDateTime function to convert both sides of the condition to the same date format, for example: formatDateTime (utcNow(), 'yyyy-MM-dd')

    2. You may encounter the problem of jet lag, which causes the two sides of the condition to be unequal. You can consider using the convertFromUtc or convertTimeZone functions.

    vliweimsft_0-1666338832891.jpeg

    I think this link will help you:

    Reference guide for expression functions - Azure Logic Apps | Microsoft Learn

    Reference guide for expression functions - Azure Logic Apps | Microsoft Learn

     

    Best Regards,

    Levi

     

  • Verified answer
    Alex_Noble Profile Picture
    9 on at

    We managed to solve this by looking at our other Salesforce system and getting the Team Members object, then once we had all the data with no filter, we could see date format is yyyy-mm-dd so we set the filter query as: 

    End_Date__C eq formatDateTime(utcNow(),'yyyy-MM-dd')

    We then do a condition which is this End Date is equal to formatDateTime(utcNow(),'yyyy-MM-dd')

    If yes then disable the account.

    Alex_Noble_1-1666621733063.png

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard