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 III
Dual Super User III

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

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

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

Highlighted
Dual Super User III
Dual Super User III

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

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

@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 III
Dual Super User III

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
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,760)