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

Formula not working on EditForm1

I have a 3 screen out of the box form that I am having just one issue with. 

 

On EditForm1 I have the below formula. It is set so that if the form is new, it finds the last ID, then grabs the column FormIDNumber and adds 1 (this part works fine) but if I am just editing the current record, it will not pull it's Parent.Default. On EditForm1, I have the DefaultMode set to FormMode.Edit.

 

Formula

Concatenate("IRF-",Text(If(EditForm1.Mode=FormMode.New,First(Sort('IRF Center (New)',ID,Descending)).FormIDNumber + 1,Parent.Default)))

 

This is day 3 for me. 🙂 What am I missing?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Dual Super User
Dual Super User

Re: Formula not working on EditForm1

I've never been able to get IF() functions embedded inside other functions to work.  I know its more cumbersome, but I think you need to format it this way.

If(EditForm1.Mode=FormMode.New,Concatenate("IRF-",Text(First(Sort('IRF Center (New)',ID,Descending)).FormIDNumber + 1)),Concatenate("IRF-",Parent.Default))


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted
Community Champion
Community Champion

Re: Formula not working on EditForm1

It's means resolved. Then you can mark it as The solution to close it.

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

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

5 REPLIES 5
Highlighted
Helper I
Helper I

Re: Formula not working on EditForm1

I actually wanted to add that it is seeing the correct FormIDNumber in the attached.

Highlighted
Dual Super User
Dual Super User

Re: Formula not working on EditForm1

I've never been able to get IF() functions embedded inside other functions to work.  I know its more cumbersome, but I think you need to format it this way.

If(EditForm1.Mode=FormMode.New,Concatenate("IRF-",Text(First(Sort('IRF Center (New)',ID,Descending)).FormIDNumber + 1)),Concatenate("IRF-",Parent.Default))


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted
Community Champion
Community Champion

Re: Formula not working on EditForm1

It's means resolved. Then you can mark it as The solution to close it.

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

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

Highlighted
Helper I
Helper I

Re: Formula not working on EditForm1

@Pstork1 !! That worked! Thank you so much. I got a double IRF-IRF-123 so i removed the last "Concatenate("IRF-" and left the ",Parent.Default) and it works perfectly. Thank you so much!

 

Highlighted
Dual Super User
Dual Super User

Re: Formula not working on EditForm1

That would make sense if the IRF- prefix is part of the default. It wasn't completely clear from the original formula, but I figured the embedded IF() was the real problem.  Glad its working.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (12,241)