question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there any easy way to get data from previous step?

See original GitHub issue

Is there any easy way to get data from previous step using queue?

var steps = [
        {
            title: 'Some radio buttons',
            type: 'question',
            input: 'radio',
            inputValue: 'a',
            inputOptions: {
                a: 'A',
                b: 'B'
            },
            inputValidator: function (value) {
                return new Promise(function (resolve, reject) {
                    if (value == 'a' || value == 'b') {
                        resolve()
                    } else {
                        reject('You need to pick one!')
                    }
                })
            }
        },
        {
            title: 'Select',
            type: 'question',
            text: 'Chaining swal2 modals is easy',
            input: 'select',
            inputOptions: THIS WILL DEPEND ON PREVIOUS STEP CHOICE
        },
    ]

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
Kyslikcommented, May 30, 2017

Alright, I think I finally got it, but Its so hacky 😦 !

preConfirm: function (dataFromPreviousStep) {
    return new Promise(function (resolve) {
          swal.insertQueueStep({STEP HERE THAT USES dataFromPreviousStep})
          resolve()
    })
  }

I propose to make some kind of magic to get the value from previous step(s) (or make values available globally).

0reactions
Kyslikcommented, May 30, 2017

@limonte Hello again: insertQueueStep wants 2 parameters but your example uses only one.

signature sweetAlert.insertQueueStep = function (step, index) {...}

preConfirm: function () {
    return new Promise(function (resolve) {
      $.get('https://api.ipify.org?format=json')
        .done(function (data) {
          swal.insertQueueStep(data.ip)
          resolve()
        })
    })
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get data of a previous step in django FormWizard
In order to recieve data from previous step, one must. A) Implement get_form_initial(self, step) for view class W1_Estim
Read more >
How to get values from previous step in a query wi...
You can try Advanced Group By for the original table. Group by "Business ID", "Purchase" and "Method" columns at the same time and...
Read more >
Find previous record - a tricky Power Query Example - YouTube
This video demonstrates how you can pre-shape data based on the previous record in a data set. It is part of my online...
Read more >
Data not saving on previous step in web forms
I would suggest/recommend to try any of below two methods,. 1. Use jquery/javascript, loop through all the controls and check if any value...
Read more >
Use iCloud to transfer data from your previous iOS or iPadOS ...
Tap a Wi-Fi network to join. Follow the steps until you see the Apps & Data screen, then tap Restore from iCloud Backup....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found