Is It Possible to write while or for loop in formula field?

  • 0
  • 1
  • Question
  • Updated 6 months ago
  • Answered
Is It Possible to write while or for loop in formula field?

 If possible ple explain with example.

Thanks
Photo of Anvika Reddy

Anvika Reddy

  • 220 Points 100 badge 2x thumb

Posted 7 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 53,240 Points 50k badge 2x thumb
No, at least not with native Quick Base. It is more like Excel in that regard where there are formulas in fields

However, if you know JavaScript, then you can write code pages which can have programs.
Photo of Anvika Reddy

Anvika Reddy

  • 220 Points 100 badge 2x thumb
Thanks , 
I know JavaScript,How to call this code pages? 
Photo of Lane Pemberton

Lane Pemberton

  • 164 Points 100 badge 2x thumb
A link or further clarification would be helpful. Googling your answer leads to a certain type of eye surgery.
Photo of Lane Pemberton

Lane Pemberton

  • 164 Points 100 badge 2x thumb
Thank you Scott!
Photo of Anvika Reddy

Anvika Reddy

  • 220 Points 100 badge 2x thumb
Thanks guys,

Is it Possible to call JavaScript With out using  IOL technique?
Photo of Gaurav Sharma

Gaurav Sharma

  • 5,760 Points 5k badge 2x thumb
Hi Anvika,

Try this.
"<img qbu=\"module\" src=\"/i/clear2x2.gif\" " &
"onload=\"javascript:if(typeof QBU=='undefined'){QBU={};$.getScript('" &
URLRoot() &
"db/" &
Dbid() &
"?a=dbpage&pagename=test.js&rand='+Math.random())}\">"
Create a test.js page and put an alert to test out if this working or not.

Thanks,
Gaurav
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 27,994 Points 20k badge 2x thumb
You can't write a loop in the formula language. While you can write all sorts of loops and recursive procedures in JavaScript I have to ask what are you trying to accomplish?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 27,994 Points 20k badge 2x thumb
>Is it Possible to call JavaScript With out using  IOL technique?

All other techniques are largely just going to be variants of the IOL technique. Why not just use the accepted method which is adequately documented and for which there are 100s of public solutions available in the Pastie Database? I somehow sense that you are reluctant to try the IOL technique - just take the plunge and you will be pleased with the result.
Photo of Micro Dev

Micro Dev

  • 834 Points 500 badge 2x thumb
How do I loop to lookup the next record that exists with one lower number of the record I am currently on.

I have a key field call ID but sometimes it can skip a number since the table is being imported from a SQL server. 

I want to lookup the last call ID before the current one and it should subtract 1 until it finds a record with that Call ID.