Run form again if conditions not met

Welcome Forums General PowerShell Q&A Run form again if conditions not met

Viewing 2 reply threads
  • Author
    Posts
    • #278928
      Participant
      Topics: 2
      Replies: 9
      Points: 30
      Rank: Member

      Hello,

      I’m trying to figure out how to solve the following situation:

      I have a script with a form with 2 buttons: ok and calncel

      ok >  (should) return 3 values (1 input and 2 dropdownlist)

      cancel > returns one value of the form with a hard coded value and end (break) the execution

       

      After I complete the form, I’m running “COMPARE” function that contains multiple comparisons (if, elseif) where I compare those 3 values from OK button, with different scenarios.

      ex: if one from three fields are empty, I want to rerun the form

      all good for the first comparison but, if I let one field empty, the form runs again but second comparison run ends with the values obtained from the first run. From what I understand, I have to run again “run” function (loop) but I can’t figure it out how to do it right.

      What I’m missing?

      • This topic was modified 1 month, 1 week ago by Adrian R.
      • This topic was modified 1 month, 1 week ago by Adrian R.
      • This topic was modified 1 month, 1 week ago by grokkit. Reason: code formatting - please read the guide
    • #278967
      Participant
      Topics: 17
      Replies: 1951
      Points: 3,986
      Helping Hand
      Rank: Community Hero

      Perform the validation when you are in the form rather than attempting to start the form again. Try submitting with no user and then put something in the user field:

    • #279030
      Participant
      Topics: 2
      Replies: 9
      Points: 30
      Rank: Member

      Thanks for your reply.

      I also tried something similar. Unfortunately, no luck on returning the values and/or run other commands/functions.

       

      If everything is ok (else in your example), I need to run one or more functions that are using those 3 values. Unfortunately, I can’t make it call the function, not even an echo after I press “ok” button.

       

      • This reply was modified 1 month, 1 week ago by Adrian R.
Viewing 2 reply threads
  • You must be logged in to reply to this topic.