cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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

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
Helper I
Helper I

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

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

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

@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!

 

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (43,019)