cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
T_Findeisen
Level: Powered On

Param("EntityId") ignoring leading 0s

Hello everybody,

 

I created a PowerApp that can be embedded in the Products table to translate the corresponding Description with Microsoft Translate.

I get the original description with a simple LookUp(Table, productnumber = Param("EntityId); Description).

It works for most cases as intended. Problem is only with the products where the productnumber starts with a 0, e.g: 0001.

In that case Param("EntityId") is not '0001' but '1' and my lookup returns empty since productnumber = 0001, not = 1.

 

Anybody know how to fix it, that Param("EntityId") returns the complete number with the leading 0s?

 

Regards

T Findeisen

1 ACCEPTED SOLUTION

Accepted Solutions
T_Findeisen
Level: Powered On

Re: Param("EntityId") ignoring leading 0s

Hello everybody,

 

the type of the original parameter is a string (ProductNumber in picture).

When I used Text(Value(Param("EntityId"), "000#") while EntityId was a string, it returned an empty result.

It worked though when EntityId only contained numbers.

 

My final solution looks like this for anybody who is interested:

If(
!IsBlank(Param("EntityId")) && IsNumeric(Param("EntityId")),
Set(FinOpsInput, Text(Value(Param("EntityId")),"[$-de-DE]000#")),
!IsBlank(Param("EntityId")) && !IsNumeric(Param("EntityId")),
Set(FinOpsInput, Param("EntityId")),
Set(FinOpsInput, "")
)

I then call the variable in the LookUp.

 

Ty for all your help

View solution in original post

6 REPLIES 6
PowerApps Staff C_Ian_Davis
PowerApps Staff

Re: Param("EntityId") ignoring leading 0s

Hi T_Findeisen,

 

A fix that may work (but, admittedly, is not exactly the one you're looking for) is to use the Value function to essentially force the comparison to compare only the number values of productnumber and Param("EntityId"). It would look like this:

 

LookUp(Table, Value(productnumber) = Value(Param("EntityId"); Description)

 

For more information on the Value function, see this page

 

Let me know if this works for you.

Super User
Super User

Re: Param("EntityId") ignoring leading 0s

Try wrapping the result in Text(Param("EntityId"),"0000") to force the result to use the leading zeros.

T_Findeisen
Level: Powered On

Re: Param("EntityId") ignoring leading 0s

Thank you for the fast responses.

 

Sadly the value-solution is not feasible in this case, since the original EDT is of the type string and can contain letters as well as numbers.

Value would work for number fields like you suggested but would change any letter into a number, too.

 

As for Text(Param("EntityId"); "0000"):
I tried that, too,  also in a seperate field to see the result and the returned result for some reason was still only "1".

Here I have no idea what there reason for that is.

Rick72
Level 10

Re: Param("EntityId") ignoring leading 0s

Hi @T_Findeisen,

 

I cannot reproduce your issue. When I add 0001 as value of a parameter and use it as the property "Text" of a label, it shows 0001.

 

Perhaps the issue is the field "Productnummer". Of what type is it?

 

Robot Happy Rick

Community Support Team
Community Support Team

Re: Param("EntityId") ignoring leading 0s

Hi @T_Findeisen,

 

Could you please share a bit more about the data type of the productnumber column? Is it a String type column?

 

If the data type of the peoductnumber column is a String type, please take a try with the following formula:

LookUp(Table, productnumber = Text(Value(Param("EntityId")),"[$-en-US]000#"), Description)

Or

LookUp(Table, productnumber = Text(Value(Param("EntityId")),"[$-en-US]0000"), Description)

 

then check if the issue is solved on your side.

 

Best regards,

Kris 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
T_Findeisen
Level: Powered On

Re: Param("EntityId") ignoring leading 0s

Hello everybody,

 

the type of the original parameter is a string (ProductNumber in picture).

When I used Text(Value(Param("EntityId"), "000#") while EntityId was a string, it returned an empty result.

It worked though when EntityId only contained numbers.

 

My final solution looks like this for anybody who is interested:

If(
!IsBlank(Param("EntityId")) && IsNumeric(Param("EntityId")),
Set(FinOpsInput, Text(Value(Param("EntityId")),"[$-de-DE]000#")),
!IsBlank(Param("EntityId")) && !IsNumeric(Param("EntityId")),
Set(FinOpsInput, Param("EntityId")),
Set(FinOpsInput, "")
)

I then call the variable in the LookUp.

 

Ty for all your help

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,068)