cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NJessen
Helper I
Helper I

Powerapps - sum of cells can't exceed 100

Hi,

 

I'm trying to build an expense app.

 

The user is supposed to choose the cost center so what area is responsible for the purchase.

 

Here I have the cells: Kitchen // Cleaning // Bar // Other

 

I made these cells from a sharepoint list where they are made as a "Number column"

 

I tried with the upload form button but for some reason it won't let me do it that way.

The error I get is something along the lines of: 

"Invalid argumenttype (number). Expecting a boolean-value instead."

 

Pic of the syntax, cells and the error:

NJessen_0-1632985908147.png

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions

If(
Value(DataCardValue9.Text)+Value(DataCardValue10.Text)+Value(DataCardValue11.Text)+Value(DataCardValue12.Text)=100;
   SubmitForm(EditForm1);
   Error("Fejl")
)

 

What do you want to achive with Error("Fejl") ? If you want to notify the user about the error use Notify() function.

Here is the syntax:

NotifyMessage [, NotificationType [ , Timeout ] ] )

 

View solution in original post

6 REPLIES 6
gabibalaban
Dual Super User
Dual Super User

@NJessen ,

Can you show the formula again ? It can’t be distinguished very clear in your picture.

Do you have a condition in the first part of if clause, because it seems to be a sum there and the error exactly that says.

NJessen
Helper I
Helper I

@gabibalaban Thanks for your answer

NJessen_0-1632987850856.png

 

This is my input in text:

 

If(Value(DataCardValue9.Text)+Value(DataCardValue10.Text)+(Value(DataCardValue11.Text)+(Value(DataCardValue12.Text)=100;SubmitForm(EditForm1);Error("Fejl")

 

If(

Value(DataCardValue9.Text)+Value(DataCardValue10.Text)+(Value(DataCardValue11.Text)+(Value(DataCardValue12.Text)=100;

     SubmitForm(EditForm1);

     Error("Fejl")

)

 

There are 2 unclosed brackets in your formula (point with bold). Can you remove it ?

@gabibalaban 

I fixed the formula error, thanks.

 

The formula is now:

 

If(
Value(DataCardValue9.Text)+Value(DataCardValue10.Text)+Value(DataCardValue11.Text)+Value(DataCardValue12.Text)=100;
   SubmitForm(EditForm1);
   Error("Fejl")
)

NJessen_0-1632991926892.png

 

I'm however still getting a error, but a new one.

Now it just says, invaled argumenttype.

 

/Nikolai

If(
Value(DataCardValue9.Text)+Value(DataCardValue10.Text)+Value(DataCardValue11.Text)+Value(DataCardValue12.Text)=100;
   SubmitForm(EditForm1);
   Error("Fejl")
)

 

What do you want to achive with Error("Fejl") ? If you want to notify the user about the error use Notify() function.

Here is the syntax:

NotifyMessage [, NotificationType [ , Timeout ] ] )

 

Thank you so much! This was a great help.

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,619)