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 Apps / An error occurred on t...
Power Apps
Answered

An error occurred on the server. Server Response: Incidents failed: Bad Gateway (502)

(1) ShareShare
ReportReport
Posted on by 588

My app is throwing the above error when I go to re-submit a form which has been edited. 

 

A New Form submit works fine, but when I go back to the gallery, select any previous record, and try to edit it does not submit.

 

error occurred.png

I've tried good ol' google with no luck, some people seem to suggest the error should go after a few tries, but no luck there either. I've tried refreshing the data source etc. and I've also remade the app from scratch and it throws the same error again.

 

The main error message appears to be:

"message": "Error reading string. Unexpected token: StartObject. Path 'Value', line 2, position 13.\r\nclientRequestId: 5e78521b-d14b-433f-a888-5edb7abfba9c\r\nserviceRequestId: 5e78521b-d14b-433f-a888-5edb7abfba9c"

 

Is this referring to a specific data card? Can I identify where 'line 2, position 13' is?

 

I did the full monitoring troubleshoot and it came up with the attached details. 

 

Any help is greatly appreciated, this is the last hurdle on a project which has taken me quite some time!

 

 

Categories:
  • Verified answer
    misc Profile Picture
    588 on at

    UPDATE: I found a fix and thought it would be prudent to provide it here for others who come across a similar error:

     

    1) I duplicated the screen and deleted each data card one by one until I found the one which was creating the error (turns out it was a dropdown which is linked to a Choices sharepoint list)

    2) I found out that the error did not occur if I 'edited' this data card before re-submitting (even if I just deleted and selected the same option)

    3) Logic showed this was probably due to my DefaultSelectedItems property which was:

    If(
     ReportForm.Mode = FormMode.New && DataCardValue2.Selected.Value = "Fire Report", ["Fire incident"],
     ReportForm.Mode = FormMode.New && DataCardValue2.Selected.Value = "Building Report", ["Damage to property"],
     ReportForm.Mode = FormMode.New && DataCardValue2.Selected.Value = "Incident Report", ["Miscellaneous"],
     ReportForm.Mode = FormMode.Edit, [Parent.Default])

     

    To fix, all I had to do was change [Parent.Default] to ThisItem.'Incident Category'.

     

     

  • GuillaumeP Profile Picture
    29 on at

    Thank you !! 4 days i battled with this error. Same case, a dropdown which is linked to a Choices sharepoint list with DefaultSelectedItems property.

    I just deleted it, added it again, modified properties as before and it works...

     

    Guillaume

  • Adam-Artelia Profile Picture
    5 on at

    I was getting a similar error, lots of googling to try and isolate the problem and this was it. I was generating collections on a toggle to update default selected items in a choice box, and this saved me hours of searching. Thank you!

  • ardas91 Profile Picture
    5 on at

    I have just come across the situation.

    If this returns Bad Gateway with error code 502, do the following. 

     

    Remove the "i:0#.f.|membership|" prefix in the "Claims" tag and pass the email in the claims directly.

     

    Example:

    {.. Claims: "i:0#.f.|membership|"&Lower(User().Email) } --> this is a normal syntax.

     

    Try this, 

    {.. Claims: Lower(User().Email) --> This may work for you.

     

    Happy Coding!!!

     

     

     

     

     

  • alexaso Profile Picture
    39 on at

    @misc thank you... 

  • ALDAHEGI Profile Picture
    2 on at

    "message": "Error al leer la cadena. Token inesperado: StartObject. Ruta 'Valor', línea 2, posición 13.\r\nclientRequestId: 5e78521b-d14b-433f-a888-5edb7abfba9c\r\nserviceRequestId: 5e78521b-d14b-433f- a888-5edb7abfba9c"

     

    El error que ocurre sucede cuando agregamos un cuadro combinado a un campo, esto suele suceder cuando necesitamos actualizar el campo del formulario pero este depende de una lista desplegable, en la propiedad DefaultSelectItem del cuadro combinado lo que hacemos es agregar la siguiente función  [{Value :ThisItem.Nombredelcampo}] para que nos cargue el parent.default del campo, sin embargo, el campo original que viene en el fomulario se debe eliminar, y agregar al bloque que contiene el campo en su propiedad Update el ComboBox del cuadro combinado así :  ComboBox23.Valor.Seleccionado. Al hacer esto se solucionó el problema, no es un tema temporal, es permanente si no se realiza la actualización.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard