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 / multiple expressions a...
Power Apps
Unanswered

multiple expressions and variable condition in Canvas App

(0) ShareShare
ReportReport
Posted on by 26

I have a chain of expressions on a button click event where I keep updating the context variable errorMsg and at the end check to see if the variable is empty(IsEmpty/IsBlank) to do one thing or do another. For some reason it always appears to be finding variable errorMsg to be empty. I am assuming that this is probably due to this being evaluated before the previous expressions are executed. Is this understanding correct ? And how do I overcome this.

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    Please can you show your expression.
    Check out difference in IsEmpty/Isblank
    https://powerusers.microsoft.com/t5/Building-Power-Apps/IsBlank-IsEmpty-or-quot-quot/td-p/180395

     

    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution

  • bravoss Profile Picture
    26 on at

    Here is a snippet of the expression that I use

    UpdateContext({
    varErrorMsg:
    If(IsBlank(DataCardValue2.Selected.Value),Concatenate(varErrorMsg,"Error: 1"),Concatenate(varErrorMsg,""))
    });
    UpdateContext({
    varErrorMsg:
    If(!IsBlank(DataCardValue12)&&IsBlank(DataCardValue15),Concatenate(varErrorMsg,Char(13),"Error: 2."),Concatenate(varErrorMsg,""))
    });
    UpdateContext({
    varErrorMsg:
    If(DateDiff(DateTimeValue(Text([@ModelDrivenFormIntegration].Item.'End Date',DateTimeFormat.ShortDate) ),(DataCardValue12.SelectedDate))>0,Concatenate(varErrorMsg,Char(13),"Error: 3."),Concatenate(varErrorMsg,""))
    });
    SubmitForm(Form1);
    If ((IsEmpty(varErrorMsg)) ,
    Navigate(SCR_1) ,
    Navigate(SCR_2)
    );

     

    Note: IsEmpty/IsBlank have both been tried by me.

  • WarrenBelz Profile Picture
    155,779 Most Valuable Professional on at

    Hi @bravoperss ,

    Can you please use Format Text on this code and post in a box (</> icon at end of first row above) and I will have a look at it for you.

     

  • bravoss Profile Picture
    26 on at

    Thanks for the reply. The above now appears to be working for me. I am not sure what resolved it if it was an issue with the expression or clearing of variables, but it now works fine.

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard