Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Doing excel upload but one integer field is getting always 0.

(0) ShareShare
ReportReport
Posted on by 502

Hi All,

duration = cells.item(row, 4).value().int();

variable duration is getting always 0 value instead of the whole number.

Can you please help me in this?

workbook = workbooks.item(1);
    worksheets = workbook.worksheets();
    worksheet = worksheets.itemFromNum(1);
    cells = worksheet.cells();
    do
    {
        row  ;
        id = cells.item(row, 1).value().bStr();
        name = cells.item(row, 2).value().bStr();
        description = cells.item(row, 3).value().bStr();
        duration = cells.item(row, 4).value().float();
        url = cells.item(row, 5).value().bStr();

 

        certification_Name.CertificationId = id;
        certification_Name.Name = name;
        certification_Name.Description = description;
        certification_Name.Duration = duration;
        certification_Name.URL = url;

 


        //if(HcmWorker::findByPersonnelNumber(lECN))
            certification_Name.insert();
        type = cells.item(row 1, 1).value().variantType();
    }

Thanks and regards

Siddhant Singh

  • Martin Dráb Profile Picture
    Martin Dráb 230,433 Most Valuable Professional on at
    RE: Doing excel upload but one integer field is getting always 0.

    What exactly do you get if you use bStr()?

  • Siddhant Singh Profile Picture
    Siddhant Singh 502 on at
    RE: Doing excel upload but one integer field is getting always 0.

    Yes , its an integer value. I have checked the format also.

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Doing excel upload but one integer field is getting always 0.

    Is that field in Excel really an integer?

  • Siddhant Singh Profile Picture
    Siddhant Singh 502 on at
    RE: Doing excel upload but one integer field is getting always 0.

    Actually I tried using both float() and int() , but didn't work with both.

  • Martin Dráb Profile Picture
    Martin Dráb 230,433 Most Valuable Professional on at
    RE: Doing excel upload but one integer field is getting always 0.

    I see you're using float(), not int(), in your actual code. Does it work with float()?

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,703 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans