Forum Discussion

Re: Random Pin Generator

Mark's pipeline sample works well, I use a version of it to send out random surveys on record save. Complete this with a check box/flag to record if you have already generated the pin or not.  e.g. pipeline would trigger on update, set the random pin to the jinja output, set the "it's already set" flag to TRUE and then end.  You'd trigger only on record update where the "it's already set" flag is false. 



------------------------------
joe vandervest
------------------------------

6 Replies

  • WilliamHunter's avatar
    WilliamHunter
    Qrew Trainee

    Perfect thank you both!



    ------------------------------
    William Hunter
    ------------------------------
  • WilliamHunter's avatar
    WilliamHunter
    Qrew Trainee

    Mark,

    Can you explain the elements of this formula so I can better understand it? 

    ToNumber(Right(ToText(Int([Record ID#]*9973/127)),4))

    I am asking because this seems like a good quick way of doing this, but I am getting some values under 4 digits.



    ------------------------------
    William Hunter
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend

      Yes, that formula could have numbers as low as 1, which would just be 1 digit.

       You could try this instead as a text field type. That would zero pad if shorter than 4 digits.

      PadLeft(Right(ToText(Int([Record ID#]*9973/127)),4),4,"0")



      ------------------------------
      Mark Shnier (Your Quickbase Coach)
      mark.shnier@gmail.com
      ------------------------------
      • WilliamHunter's avatar
        WilliamHunter
        Qrew Trainee

        Worked like a charm. Thank you again!



        ------------------------------
        William Hunter
        ------------------------------