Forum Discussion

JordanBeatty1's avatar
JordanBeatty1
Qrew Captain
8 years ago

Is there an easy way to swap fields in reports in mass?

I am trying to swap a field in a report with a different field, which isn't an issue except it is used in 50+ reports. Is there an easier way to do this rather then me swapping them all one at a time? 
  • Hi Jordan,

    Unfortunately there isn't an easy way to natively mass swap a field amongst all of your reports if they are set to custom. Any report that is set to the reporting defaults can be edited by going into the reporting defaults and editing the fields you want displayed there. Alternatively, any reports set to custom columns requires going into that specific report and reassigning the custom columns natively. 

    I would encourage you though to include that feedback in our User Voice as a business need for your company. UserVoice is our Feedback Platform- which can most easily be accessed from the My Apps page in Quick Base by clicking on the orange Feedback tab that appears on the left hand side of the page or at http://quickbase.uservoice.com .  This forum is used by our development team to explore customer suggestions for enhancements / changes to the platform. I'm sorry there wasn't an easier native fix I could recommend.
  • Yes there is an easy way to do this with script.

    The following essential code applied to the page ?a=DformProps&dfid=2 will substitute the existing fid=7 with the fid=8 in the form.
    var fidFrom = "7";
    var fidTo = "8";
    $("input[type=hidden][name^=hfi]")
      .filter(function() {
        var value = $(this).val().split("~*~")[2];
        if (value == fidFrom) {
          return true;
        }
      })
      .next("select")
      .val(fidTo);
    To get the code to convert all fifty forms you simply have to wrap a loop around it using an <iframe> and submit the form using native Submit or FormData. I would create a demo but it is hard to do so and make it available to everyone on the internet.

    Notes:

    (1) The script basically selects all hidden inputs on the form with a name attribute starting with the characters "hfi". Next if filters out the single input for which the third "~*~" delimited string is the fidFrom value. Finally it changes the following <select> value to the fidTo value.

    It may seem all mysterious but QuickBase uses a proprietary encoding of all the form's properties in various delimited strings stored as attributes on hidden <input>s - in this case the delimiter is the three character string "~*~".

    (2) Don't let anyone tell you it can't be done with QuickBase.