cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vishwa05
Frequent Visitor

How to remove decimal in lookup field in PowerApp Edit & Display form ?

Hi All,

I have a lookup field (Lookup from number type field). When I save item, it saves as example - 1,009 or 11,22,3000 but when I open in Edit or Display form it comes 1009 as 1009.00000000000 or 11,22,3000 as 11223000.0000000. I want to remove all decimal number it should show only number without decimal such as 1009  or 11223000.

Formula - In Default - Parent.Default

                OnSelectedItem - Parent.Default

Note -  This is not working because here it has Lookup field not number field. Text(Value('LegalID'),"[$-en-US]#.0"))

Please help to remove decimal from Lookup field in edit & display form.

 

Thanks.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Vishwa05 ,

Based on the issue that you mentioned, I have made a test, and the issue is confirmed on my side.

 

As an alternative solution, I think the Text function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

6.JPG

Set the DefaultSelectedItems property of the LookUp field (CurrencyLookUp) ComboBox to following:

{
    Id: LookUp('20190701_case7', CurrencyNum = Value(ThisItem.CurrencyLookUp.Value), ID),
    Value: Text(Value(ThisItem.CurrencyLookUp.Value), "[$-en-US]##,###,###")
}

Note: The 'CurrencyLookUp' field references values from the CurrencyNum Number field in my '20190701_case7' list (another list)

 

On your side, please take a try with the following formula within the DefaultSelectedItems property of the LegalID LookUp field:

{
    Id: LookUp('Referenced List', ReferencedNumberField = Value(ThisItem.LegalID.Value), ID),
    Value: Text(Value(ThisItem.LegalID.Value), "[$-en-US]##,###,###")
}

Note: I assume that the  LegalID field is a LookUp type field in your SP List, which references values from the ReferencedNumberField in your 'Referenced List'. Please add your 'Referenced List' as data source into your canvas app firstly.

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

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.

View solution in original post

Hi Community Support Team _ Kris Dai

It worked. Thank you so much for you help. Really I liked the way of your explanation.

Thanks a lot.

View solution in original post

5 REPLIES 5
Taeke
Frequent Visitor

Hello @Vishwa05 

Isn't is possible for you to change the definition of the field on the backend side be it a sharepoint list or a database table column?

Vishwa05
Frequent Visitor

Hi Taeke,

 

This is SharePoint list and Lookup with column which is Number type and this Number type field could not be changed. Is there any formula to remove decimal places from Lookup field?

 

Thanks,

 

v-xida-msft
Community Support
Community Support

Hi @Vishwa05 ,

Based on the issue that you mentioned, I have made a test, and the issue is confirmed on my side.

 

As an alternative solution, I think the Text function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

6.JPG

Set the DefaultSelectedItems property of the LookUp field (CurrencyLookUp) ComboBox to following:

{
    Id: LookUp('20190701_case7', CurrencyNum = Value(ThisItem.CurrencyLookUp.Value), ID),
    Value: Text(Value(ThisItem.CurrencyLookUp.Value), "[$-en-US]##,###,###")
}

Note: The 'CurrencyLookUp' field references values from the CurrencyNum Number field in my '20190701_case7' list (another list)

 

On your side, please take a try with the following formula within the DefaultSelectedItems property of the LegalID LookUp field:

{
    Id: LookUp('Referenced List', ReferencedNumberField = Value(ThisItem.LegalID.Value), ID),
    Value: Text(Value(ThisItem.LegalID.Value), "[$-en-US]##,###,###")
}

Note: I assume that the  LegalID field is a LookUp type field in your SP List, which references values from the ReferencedNumberField in your 'Referenced List'. Please add your 'Referenced List' as data source into your canvas app firstly.

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

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.

View solution in original post

Hi Community Support Team _ Kris Dai

It worked. Thank you so much for you help. Really I liked the way of your explanation.

Thanks a lot.

View solution in original post

It works perfect with the number field,

Two queries:

 

  1. How can I get it to show two decimal places?
  2. How do I make a capo that is of type date? I only need it to show the date and not the time. 
{
    Id: LookUp('20190701_case7', CurrencyNum = Value(ThisItem.CurrencyLookUp.Value), ID),
    Value: Text(Value(ThisItem.CurrencyLookUp.Value), "[$-en-US]##,###,###")
}

Thank You Very Much

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (14,703)