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

Need help in validation

Hello,

 

I have tried creating list form with Power apps and added below validation on button click:

If(
!IsBlank(LookUp('Employee Satisfaction Survey',Title = varUserName)),
Notify("You have already Submitted record", NotificationType.Warning); Navigate(Sorry),
Patch('Employee Satisfaction Survey', Defaults('Employee Satisfaction Survey'), {Title: User().FullName,Result:BGreen.Text}); Navigate('Thank You') )

 

Few hours before it was working then I was checking for other condition implementation and it stopped working now. I mean it doesn't give any warning even though I have already submitted records today.

 

Please guide me, where I go wrong.

 

Thanking you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@jayashri 

Had you sufficiently refreshed your browser and the app and allowed time for your published app to activate?  Sometimes that takes a few refreshes to get the new app.

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

View solution in original post

4 REPLIES 4
RandyHayes
Super User III
Super User III

@jayashri 

The only aspect of your Formula that is a little off is that you are using two different things to set the Title column.  I don't know how you are setting the varUserName, but for clarity, you should use it in both places.  Also, consider the following changes:

If(
    LookUp('Employee Satisfaction Survey',Title = varUserName, true),

    Notify("You have already Submitted record", NotificationType.Warning); 
    Navigate(Sorry),

    Patch('Employee Satisfaction Survey', Defaults('Employee Satisfaction Survey'), 
        {Title: varUserName,
         Result:BGreen.Text
        }
    ); 
    Navigate('Thank You') 
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
jayashri
Helper I
Helper I

@RandyHayes  Thank you for the reply. This works for me as well I forgot to click on "Run On start" as below:

jayashri_0-1613448495763.png

But this works until when I run this app from powerapps browser once I publish this to SharePoint, even though I have already submitted record still it's accepting another record and not navigating to "Sorry" page.

 

I have added same code on as below: 

jayashri_1-1613448763158.png

 

Please guide me on this.

RandyHayes
Super User III
Super User III

@jayashri 

Had you sufficiently refreshed your browser and the app and allowed time for your published app to activate?  Sometimes that takes a few refreshes to get the new app.

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

View solution in original post

Thank you. Yes it worked. 🙂 Thank you so much.

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

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