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

If Is Blank function (to compare database with user inserted values to prevent duplicates being created)

Hi All, I have a problem with If is blank function.

 

On the submission button for the form I would like to add on select condition to compare the database record with inserted value by the user to make sure that it does not exist (as attached below)

 

However, it is not working and say issue is 'expected operator' Any advice would be highly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@AA53 

Your formula has a syntax error in it that should be corrected.  First, your IsBlank was missing a closing parenthesis and you were using an && (AND) operator to chain functions - you would use the ; (semicolon) to chain functions.

 

However, I would suggest the following since you are using a SubmitForm.  Consider this for your formula:

If(IsBlank(LookUp('Lessons LEARNED Database List', Title=DataCardValue24.Text, Title)),
    SubmitForm(Form1_2),
    Notify("An item with the same name, title, status and category already exists")
)

 

Then in the OnSuccess action of your form, the following Formula:

Notify("Thank you.  Form has been submitted...");
UpdateContext({SubmitStatus:"Completed"});
Navigate('LL 1', Fade)

This recommendation is because you should technically have any successful actions in the OnSuccess of the form.  That way users know that it was indeed actually successful.  With your previous formula, users would be notified of success even if it failed...not good.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

1 REPLY 1
RandyHayes
Super User III
Super User III

@AA53 

Your formula has a syntax error in it that should be corrected.  First, your IsBlank was missing a closing parenthesis and you were using an && (AND) operator to chain functions - you would use the ; (semicolon) to chain functions.

 

However, I would suggest the following since you are using a SubmitForm.  Consider this for your formula:

If(IsBlank(LookUp('Lessons LEARNED Database List', Title=DataCardValue24.Text, Title)),
    SubmitForm(Form1_2),
    Notify("An item with the same name, title, status and category already exists")
)

 

Then in the OnSuccess action of your form, the following Formula:

Notify("Thank you.  Form has been submitted...");
UpdateContext({SubmitStatus:"Completed"});
Navigate('LL 1', Fade)

This recommendation is because you should technically have any successful actions in the OnSuccess of the form.  That way users know that it was indeed actually successful.  With your previous formula, users would be notified of success even if it failed...not good.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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