web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Onselect button proble...
Power Apps
Unanswered

Onselect button problem (my code does not work and I don't know why)

(0) ShareShare
ReportReport
Posted on by

Hi, I have a problem with my code and this code is on a button onselect. Nothing in the code works and sends anything to the desired location(email, sharepoint list). And when I press on the .Text or Value() propreties, It shows 0 or the following message : Powerapps encountered an internal error trying to evaluate this expression. 

 

I just don't know why it does this and I really need help. Can someone read my code and see if there is any error ?

 

Thanks in advance,         ** (by the way my code some part of my code is in french, don't mind, I am making a french app) **

 

Here's my code : 

 

If(
Value(SoldeIN.Text) < Value(
Sum(
ShoppingCart,
ItemCost * OrderQuantity
)
); true Or false,
Navigate(Début);
Notify(
"Désolé, vous n'avez pas assez fonds dans votre compte",
NotificationType.Error,
5000
),
Office365Outlook.SendEmailV2(
"*****(myemail)******",
"Nouvelle Commande - " & Value(NumEIN.Text),
"<h3> Informations Clients </h3>" & "Nom Complet: " & NomCompletIN.Text & "<br>" & "Groupe: " & GroupeIN.Text & "<br>" & Label55.Text & "<br>" & "E-mail: " & EmailIN.Text & "<br><br>" & "<h3> Informations Commande </h3>" & "<br>" & Concat(
ShoppingCart,
"Produit: " & ItemType & "<br>" & "Coût: $" & ItemCost & "<br>" & "Quantité: " & OrderQuantity & "<br><br>",
Char(10)
) & "<br>" & "Total : " & Sum(
ShoppingCart,
ItemCost * OrderQuantity
) & " $" & "<br>" & "Date de la commande : " & Now(),
{Importance: "Normal"}
);
Office365Outlook.SendEmailV2(
User().Email,
"Votre Commande - Cafétéria",
"Ce message est pour confirmer que nous avons bien reçu votre commande. <br> <br> Nous vous remercions pour votre commande ! <br> <br> <h3> Votre Commande: </h3> <br>" & Concat(
ShoppingCart,
"Produit: " & ItemType & "<br>" & "Coût: $" & ItemCost & "<br>" & "Quantité: " & OrderQuantity & "<br><br>",
Char(10)
) & "<br>" & "Date de la commande : " & Now(),
{Importance: "Normal"}
);
Patch(
Commandecafet,
{
Title: "", NuméroÉl: Value(NumEIN.Text),
NomComplet: NomCompletIN.Text,
Groupe: GroupeIN.Text,
Total: Sum(
ShoppingCart,
ItemCost * OrderQuantity
),
SoldeDuCompte33: Value(SoldeIN.Text),
Email: EmailIN.Text,
DateDeLaCommande: Now(),
Panier: Concat(
PanierGallery.AllItems,
OrderQuantity & " " & ItemType & "; Coût: " & ItemCost & "$",
Char(10)
)
}
);
Patch(
InformationsCréerUnCompte,
LookUp(
InformationsCréerUnCompte,
SoldeDuCompte1 = Value(SoldeIN.Text)
),
{
SoldeDuCompte1: Value(SoldeIN.Text) - Sum(
ShoppingCart,
ItemCost * OrderQuantity
)
}
);
Refresh(InformationsCréerUnCompte);
Navigate(Remerciements);

);
Clear(ShoppingCart);

-----------------------------------------------------------------------------------------------------------------------------------------------

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @Anonymous ,

     

    Since it's a long formula that I would recommend you to check it part by part.

     

    Firstly, that "true Or false" part is meaningless. The If statement syntax please refer to below doc:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-if#syntax

    If(ConditionThenResult [, DefaultResult ])

     

    Secondly, you could use a button to check if sending emails part working fine, that two Patch parts as well.

     

    At last, if sending emails and Patch parts are with no problem, the front part of the formula before sending emails part would as below:

    If(Value(SoldeIN.Text) < 
    Sum(
    ShoppingCart,
    ItemCost * OrderQuantity
    ),
    Navigate(Début);
    Notify(
    "Désolé, vous n'avez pas assez fonds dans votre compte",
    NotificationType.Error,
    5000
    ),

     

    If issue persists, please share more details especially the error prompts in your formula.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Community Power Platform Member Profile Picture
    on at

    @v-jefferni  Hi, I actually solved the issue and I found out that there was no issue with the code in the onselect button. It was just another problem in my app that was affecting the onselect button and how it sent the information.

     

    Thanks for the answer!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard