web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Convert whole field to...
Power Apps
Unanswered

Convert whole field to decimal field

(0) ShareShare
ReportReport
Posted on by 180


Hello,

I want to convert whole field to decimal field.
I have whole number field on form numofMonth.

I want to create new decimal field numofMonth2 

 

is this right approach?

How can I migrate data from numofMonth field to numofMonth2 field?

 

is there better approach to implement this solution?

 

Thanks,

I have the same question (0)
  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    Hello,

    I would recommend using SSIS with KingswaySoft adapters to migrate the data.

  • Drew Poggemann Profile Picture
    9,287 Most Valuable Professional on at

    Hi @Shafdev ,

     

    Are you wanting to keep both values or only the Decimal value moving forward?  Is this just a one time migration?

     

    If one time migration, the easiest approach I would look at is the following:

    1. Add new column as decimal to the table
    2. Create a view that shows both fields
    3. Export the data to Excel
    4. Utilize Excel to set the value of the new field based on the value of the current field (I would usually follow this approach:
      1. Add a column to right of exported data (temporary) and set the value to the cell with the exported whole number (i.e. if A2 then set value of this new column as =A2)
      2. Change column format in Excel on this temporary column to have two decimal places
      3. Copy column values and "Paste Values" into your new Dataverse column you have in the output and this should put in the decimal values
      4. Remove the temporary column
    5. Import the data which will update each row and populate the new field
    6. Drop the original field from the table after removing from all forms / views etc.
  • LaurenWithers Profile Picture
    82 on at

    You could also write a plugin for migrating the data from the whole number field to the new decimal field; using the RetrieveMultiple method to retrieve all the records from the entity that contains the numofMonth field, loop through the records, and update the value of the numofMonth2 field for each.

     

    For example: 

    var query = new QueryExpression("entity_name");
    query.ColumnSet = new ColumnSet("numofMonth", "numofMonth2");
    var records = service.RetrieveMultiple(query).Entities;
    
    foreach (var record in records)
    {
     decimal numofMonth = ((int)record.GetAttributeValue<AliasedValue>("numofMonth")).Value / 100m;
     record["numofMonth2"] = numofMonth;
     service.Update(record);
    }

     

     

    If this helped please give it a thumbs up, if it solved the issue please give it a thumbs up and accept it as the solution.

    🙂 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard