During importing the dataset why certain field is always asking about the "Undo changes"?

During importing the dataset why certain field is always asking about the "Undo changes"?

adrianbadrianb Posts: 8Questions: 1Answers: 0

I've around 200 records dataset which already created by the datatable editor. After exporting the dataset and try to import it again from there it always come up with "Undo changes" for a particular field value.
I have more than 30 fields values and some are conditional ones(depend on the value of another field).
The field I am pointing out is also a conditional one and it's not the only conditional field.
Please let me know any clue to work out?
-Sanjaya

This question has accepted answers - jump to:

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    We would really need to see this to be able to understand the issue. Please can you link to your page or create a test case to demonstrate it. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • adrianbadrianb Posts: 8Questions: 1Answers: 0
    edited March 2020

    Please visit
    https://dhhs-dev.sphinx.org.au/scenariocreator/GastroscopyTestingDataSetCreator.html

    Let me know the bestway to send you the dataset (.csv file)?

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    I just tried the import with your sample file, thanks for mailing that, and it all behaved as expected. All 189 records were added without an error. Have you fixed the issue or am I missing something?

    Colin

  • adrianbadrianb Posts: 8Questions: 1Answers: 0
    edited March 2020

    Did you come across this situation during your import?

    To me it's happening all the time irrespective to repetitve imports.

    This will change the value of csv file field value of "Known Barrett’s oesophagus"

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Ah I see, I missed that, it was buried in the import.

    I suspect it's got something to do with this code block:

                $(editor.field('gord').node()).on(
                    'change', function () {
                        var value = editor.field('gord').val();
                        if (value == 'Yes, non-responsive') {
                            editor.enable('Known_Barretts_oesophagus');
                            editor.field('Known_Barretts_oesophagus').update(['No', 'Yes']);
                        } else if (value !== 'Yes, non-responsive') {
                            editor.field('Known_Barretts_oesophagus').update(['', 'No', 'Yes']);
                            editor.field('Known_Barretts_oesophagus').set('');
                            editor.disable('Known_Barretts_oesophagus');
    
                        }
                    }
                );
    

    As a test, could you try removing it please and seeing if that makes a difference,

    Colin

  • adrianbadrianb Posts: 8Questions: 1Answers: 0
    edited March 2020

    Hi colin,

    Great help I changed the else condition with actuals which is now working alright.

    Thanks for your clue.

     $(editor.field('gord').node()).on(
                    'change', function () {
                        var value = editor.field('gord').val();
                        if (value == 'Yes, non-responsive') {
                            editor.enable('Known_Barretts_oesophagus');
                            editor.field('Known_Barretts_oesophagus').update(['No', 'Yes']);
                        // } else if (value !== 'Yes, non-responsive') {
                        } else if (value == 'No' || value=='Yes, recent onset') {
                            editor.field('Known_Barretts_oesophagus').update(['', 'No', 'Yes']);
                            editor.field('Known_Barretts_oesophagus').set('');
                            editor.disable('Known_Barretts_oesophagus');
    
                        }
                    }
                );
    

    Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Excellent, glad all sorted.

    Colin

This discussion has been closed.