cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FoOtY1337
New Member

Submitting form with error handling

Hello all! I'm still learning PowerApps. I'm trying to create a form with some basic error handling. It working at the moment but it always throws me the error message even though it did patch the datasource correcly. I think I'm overlooking something but can't really seem to find the culprit.

 

My code is as follows:

 

If (
IsBlank(tbNameDesk.Text);Notify("Vul het veld ""Naam"" in...");
IsBlank(tbFloorDesk.Text);Notify("Vul het veld ""Verdieping"" in...");
IsBlank(tbMapDesk.Text);Notify("Vul het veld ""Plattegrond URL"" in...");
IsBlank(tbDescrDesk.Text);Notify("Vul het veld ""Beschrijving"" in...");

Patch(
    Desks;
    varManageSelectedDesk;
    {
        Title: tbNameDesk.Text;
        Floor:tbFloorDesk.Text;
        'Map Link':tbMapDesk.Text;
        Description:tbDescrDesk.Text;
        Active:toggleActive.Value
    }
);;

If(
    IsEmpty(Errors(Desks));
    // on success
    Navigate(ManageDesks)
    );

    // on failure
    Notify(
        "Fout: Er is iets mis gegaan";
        NotificationType.Error
    );

Reset(toggleActive);;
Reset(tbDescrDesk);;
Reset(tbMapDesk);;
Reset(tbFloorDesk);;
Reset(tbNameDesk);;
Set(
    varDeskMode;
    Blank()
);
Set(
   varManageSelectedDesk;
    Blank()
);;
)

 

It always throws me the error "Fout: Er is iets mis gegaan".

 

Any help would be greatly appreciated! And also in general; is this a good way to do it? 🙂

1 REPLY 1
gabibalaban
Dual Super User
Dual Super User

@FoOtY1337 ,

My feeling is that you have a small syntax confusion on the second if. There should be ;; instead of ; . Try this :

If (
IsBlank(tbNameDesk.Text);Notify("Vul het veld ""Naam"" in...");
IsBlank(tbFloorDesk.Text);Notify("Vul het veld ""Verdieping"" in...");
IsBlank(tbMapDesk.Text);Notify("Vul het veld ""Plattegrond URL"" in...");
IsBlank(tbDescrDesk.Text);Notify("Vul het veld ""Beschrijving"" in...");

Patch(
    Desks;
    varManageSelectedDesk;
    {
        Title: tbNameDesk.Text;
        Floor:tbFloorDesk.Text;
        'Map Link':tbMapDesk.Text;
        Description:tbDescrDesk.Text;
        Active:toggleActive.Value
    }
);;

If(
    IsEmpty(Errors(Desks; varManageSelectedDesk));
    // on success
    Navigate(ManageDesks)
    );

    // on failure
    Notify(
        "Fout: Er is iets mis gegaan";
        NotificationType.Error
    );;

Reset(toggleActive);;
Reset(tbDescrDesk);;
Reset(tbMapDesk);;
Reset(tbFloorDesk);;
Reset(tbNameDesk);;
Set(
    varDeskMode;
    Blank()
);
Set(
   varManageSelectedDesk;
    Blank()
);;
)

 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (2,929)