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

multiple expressions and variable condition in Canvas App

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.

4 REPLIES 4
Super User III
Super User III

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

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.

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.

 

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.

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,270)