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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,744)