cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Danny_L
Helper III
Helper III

Substitute Function Question

I have a lookup value that contains an = and numerical characters after it. Is there a way to eliminate everything from the = on to the right? Would that be a substitute or is there another function that I could use?

 

Example:

 

Current

ABC123=03

 

Want

ABC123

 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User III
Super User III

@Danny_L 

You could use the following formula:

Left(yourString, Find("=", yourString)-1)

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

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@Danny_L 

Sure thing...

If(Find("=", yourString)>0,
   // If the "=" is found in the string, then return the part up to the "="
   Left(yourString, Find("=", yourString)-1),
   // If not, then return the entire string
   yourString
)

 

_____________________________________________________________________________________
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

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
RandyHayes
Super User III
Super User III

@Danny_L 

You could use the following formula:

Left(yourString, Find("=", yourString)-1)

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

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Thanks @RandyHayes !

 

That did it. Where I was going wrong was trying to reference the same text input instead of creating another text field to display the adjusted number.

 

Thanks again.

@RandyHayes , I just realized that not every part has an = in it. Can it be conditional to where only if it contains an = to use the Left function, if not then just display the entire part number? 

 

Example
If P/N is ABC123=03 - Have it strip the =03

If P/N is ABC12345 - have it display the entire P/N?

 

 

 

@Danny_L 

Sure thing...

If(Find("=", yourString)>0,
   // If the "=" is found in the string, then return the part up to the "="
   Left(yourString, Find("=", yourString)-1),
   // If not, then return the entire string
   yourString
)

 

_____________________________________________________________________________________
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

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,900)