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.
Solved! Go to Solution.
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:
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,
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.
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?
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,
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:
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,
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.
It works perfect with the number field,
Two queries:
{ Id: LookUp('20190701_case7', CurrencyNum = Value(ThisItem.CurrencyLookUp.Value), ID), Value: Text(Value(ThisItem.CurrencyLookUp.Value), "[$-en-US]##,###,###") }
Thank You Very Much
Hi, this worked for me too so thank you. However, quite by chance I discovered that this solution stops Save from working where there are read-only/lookup columns. So the default Save stopped working, the added Save button also doesn't work until I put Parent.Default back in DefaultSelectedItems. The error that PA throws when testing is "lookupFieldName: The specified column is read-only and can't be modified". How do I apply your solution AND get Save (default or custom button) to work?
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
180 | |
46 | |
46 | |
34 | |
33 |
User | Count |
---|---|
259 | |
87 | |
79 | |
68 | |
67 |