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

Patching a change to a date field in SharePoint - Inconsistent BadGateway response

Hello,

 

I am extremely confused by an inconsistent error that I've been receiving. I have an app that is designed for making schedule changes to courses in SharePoint. The SharePoint list is a Calendar type list, which requires manual searching to connect it. I haven't run into any other issues with using this list type and I'm not sure if it is associated with that. I know that SharePoint has logic that requires the start and end time's to be sequential. But it also does not seem to be associated with that. The error occurs when I attempt to update both the start and end time to a PM time. As long as the start time is in the AM, I can generally get it to work. I have even seen that when I have the start and end time AM for the first change, I can then make a change to have them both updated to a PM time. I hope this sounds crazy because it is really odd to me.

 

Please see my start time variable (this is being created by various date, dropdown, and toggle controls):

kckyall_0-1615305951910.png

 

Please see my end time variable (this is being created using the same logic as above):

kckyall_1-1615306029690.png

 

Here is the start of a ForAll statement for the purpose of making updates to multiple selected courses at a time. I haven't even tried messing with changing dates on multiple courses, the errors are happening with just one course selected:

kckyall_2-1615306103711.png

This is the only place where the error occurs:

kckyall_3-1615306126682.png

 

I've separated the formulas out into 2 patches and have verified that it is definitely failing on the end time patch.

 

This is the error:

An error occurred on the server.

Server Response: Training Calendar failed: BadGateway

 

Other than using Flow to update the list item, does anyone have any other ideas as to why this is happening / how to fix?

 

Thanks!!

 

4 REPLIES 4
TheSec
Helper I
Helper I

Not sure if it's the same issue, but I had to completely rebuild the value to match the format for a teams calender entry.

 

Year(varStart) & "-" & Text(Month(varStart);"[$-de-DE]00") & "-" & Text(Day(varStart);"[$-de-DE]00") & "T" & Text(Hour(varStart);"[$-de-DE]00") & ":" & Text(Minute(varStart);"[$-de-DE]00") & ":00";

 

Calendars have a lot of additional settings like timezones, datetime formats etc.

I figured it out by writing and modifying the string manually until it was saved correctly.

Then I re-formated the value of my datetime variable until it worked.

kckyall
Frequent Visitor

Thanks for the reply.

Maybe I am missing something but your suggestion will turn my variable into a text variable. Power Apps will only let me Patch a date/time field with a date/time variable. Is there a way that you are converting this back to a date/time variable? I've tried that but then it will just put it right back to the same format that it was in. From what I can tell, there's only one format for a Power Apps date/time field.

I don't know which format you need. In general you can set the format with the datetime function.

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-datevalue-timevalue

 

With these functions you can format it e.g. for different languages und different precision.

In my case I switched to text to add the fractional seconds which the Teams Calendar needs, but which aren't stored in my SP fields. 

 

 

kckyall
Frequent Visitor

Got ya. Well, since it needs to be in the date/time format per SP field requirement, your suggestion won't work for my issue as it only helps for a string format. The datetime function will always bring it back to the same format, which my variable is already in

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (44,169)