Skip to main content

Notifications

Power Automate - Building Flows
Answered

Send an HTTP request to SharePoint returns bad gateway

(0) ShareShare
ReportReport
Posted on by 203

I'm using Paul Murana's YouTube video How to send Automatic Birthday / Anniversary Email using a Power Automate Cloud Flow. Strangely, it works perfectly when I use the Birthday column of my SharePoint list but not the HireDate column. Both are date columns. Any ideas why the HireDate column doesn't work?

 

This works

Aimthedame_3-1706630943736.png

 

This doesn't work

Aimthedame_2-1706630843589.png

 

  • Aimthedame Profile Picture
    Aimthedame 203 on at
    Re: Send an HTTP request to SharePoint returns bad gateway

    That's exactly what I did and it worked. Thanks so much for your time on this!

  • Verified answer
    Expiscornovus Profile Picture
    Expiscornovus 31,139 on at
    Re: Send an HTTP request to SharePoint returns bad gateway

    Hi @Aimthedame,

     

    Just realised you want this check in the HTTP request, my bad 😂

     

    Try and add a HireDate ne null check to the $filter, try this instead:

    /_vti_bin/listdata.svc/EmployeeDirectory?$filter=HireDate ne null and month(HireDate) eq @{int(formatdatetime(utcNow(), 'MM'))} and day(HireDate) eq @{int(formatdatetime(utcNow(), 'dd'))}

     

  • Expiscornovus Profile Picture
    Expiscornovus 31,139 on at
    Re: Send an HTTP request to SharePoint returns bad gateway

    Hi @Aimthedame,


    Yes, you could use a ? character for that as a wildcard in your expression.


    Try:

    item()?['HireDate']

     

  • Aimthedame Profile Picture
    Aimthedame 203 on at
    Re: Send an HTTP request to SharePoint returns bad gateway

    I finally figured it out! The only difference between the two columns is that two of the list items do not contain hire dates. When I entered dates it worked. Is there a way to leave those blank?

  • Expiscornovus Profile Picture
    Expiscornovus 31,139 on at
    Re: Send an HTTP request to SharePoint returns bad gateway

    Hi @Aimthedame,

     

    That is the bad gateway error, the first error.

     

    In your previous reply you mentioned that in one of your checks you got a different error, the one below:

    'The template language expression 'item()['HireDate']' cannot be evaluated because property 'HireDate' doesn't exist, available properties are '@odata.etag, ItemInternalId, ID, Title..

     

    I am interested in that error, that might give me some clues. Can you share a screenshot of that specific error and where you used that item()['HireDate'] expression in your check?

  • Aimthedame Profile Picture
    Aimthedame 203 on at
    Re: Send an HTTP request to SharePoint returns bad gateway

    I tried adding new columns to the list and it does the same thing but when I used Birthday, Modified, or Created it works.

     

    Aimthedame_0-1706719716569.png

     

  • Expiscornovus Profile Picture
    Expiscornovus 31,139 on at
    Re: Send an HTTP request to SharePoint returns bad gateway

    Hi @Aimthedame,

     

    Can you share a screenshot of your latest setup, that will help troubleshooting. Where did you add that expression with the item reference? 

  • Aimthedame Profile Picture
    Aimthedame 203 on at
    Re: Send an HTTP request to SharePoint returns bad gateway

    I decided to start clean just in case there was corruption somewhere along the line. I performed a Get items and then performed a compose to see the output. HireDate was listed and contained dates for 22 items. Then I checked the HireDate specifically (item()['HireDate']) and received this error.

     

    'The template language expression 'item()['HireDate']' cannot be evaluated because property 'HireDate' doesn't exist, available properties are '@odata.etag, ItemInternalId, ID, Title...

  • Expiscornovus Profile Picture
    Expiscornovus 31,139 on at
    Re: Send an HTTP request to SharePoint returns bad gateway

    Hi @Aimthedame,

     

    Thanks for checking. What is your HireDate column setup?

     

    Below is an example of the setup I used for testing and a couple of records with a HireDate value. In test only Jane should be returned today.

     

    columnsetup_hiredate.png

     

    What is your exact URI value, is it like the below?

    /_vti_bin/listdata.svc/EmployeeDirectory?$filter=month(HireDate) eq @{int(formatdatetime(utcNow(), 'MM'))} and day(HireDate) eq @{int(formatdatetime(utcNow(), 'dd'))}

     

    I have tried to reproduce your issue in my development environment. It is only returning the Jane list item in my setup without any error and that URI you shared works like expected.

     

    You might want to double check your inputs as well of the HTTP request action. Just to make sure it is compare month with 1 and day with 31 (in case of today's date).

     

    testresult_jane.png

     

     

  • Aimthedame Profile Picture
    Aimthedame 203 on at
    Re: Send an HTTP request to SharePoint returns bad gateway

    That was the first thing I checked. I should have included that in my post. Sorry!

    Aimthedame_0-1706708170373.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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard