Question
Can you setup a autofill finish from previous entries
28 replies
-
you can select priveous entries, store it in a variable and autofill it:
let myNo := No
let x:= (select table)[No = myNo -1].field
Field := x
Emanuel
-
All right. I'll give it a go. Its a little over my head but I'll try to figure it out.
Thanks so much
-
in Filemaker its called "Auto-complete using existing values" the tooltip says "allow type-ahead based on field indexes"
is this what your solution will do
-
I hope Emanuel doesn't mind me jumping in... I haven't seen this before so I wanted to try it. My solution is a little different, but with code there is always more than one way to arrive at a similar result. You would enter this in "Trigger on create" in the edit fields screen.
let prvId := number(last(select Table1).Id) - 1;
let newRec := this;
newRec.(City := text((select Table1)[Id = prvId].City));
newRec.(State := text((select Table1)[Id = prvId].State))
This copies the values from the City and State fields of the previous record to the new record.
-
@ Bill
No, there is not such a feature like Filemaker's "Auto-complete using existing values" in Ninox (for now).
Nick
-
@ Emanuel, @ Sean,
I like your solutions for autopopulating fields. Handy and clever!
-
-
Thanks everyone.
-
Sean, Re: your script to enter a City and State in a new record.
let prvId := number(last(select Table1).Id) - 1;
let newRec := this;
newRec.(City := text((select Table1)[Id = prvId].City));
newRec.(State := text((select Table1)[Id = prvId].State))
This copies the values from the City and State fields of the previous record to the new record.I tried your script to populate a field "Start Miles" with the number displayed in the previous record field "Stop Miles" in order to eliminate constantly typing in numbers. This is the script I attempted, but I continuously get an ERR("Symbol expected: )"); Miles
?!?
It's obvious that I'm not a database coder, but would appreciate any help you could provide. I'm using an iPhone 7.
-
aztory, I finally got this to work...
let prvId := number(last(select YourTableName).Id) - 1;
let newRec := this;
newRec.('Start Miles' := number((select YourTableName where Id = prvId).'Stop Miles'))
I tried to do it on my iPhone 8 first and got most of the way there, but I had to switch to my Mac to finish it. You get some error feedback on the Mac app that you don't get on the iPhone app. The code above works on both my Mac and iPhone.
-
I carefully typed in your your string and got the following: ERR (“Expression expected”)
i have an expression, but it’s probably not appropriate here.
-
Try to copy/paste the code and replace YourTableName with umm, well, you get the idea!
-
FYI, the single quote must be this type => '
-
Thank you sir for your efforts, but I still get an ERR
i have difficulty separating the code from comments. Plus the ERR just tells me something is wrong. I don’t know what is wrong, therefore I can’t fix it.
Is there a non-expert explanation?
-
The code to copy & paste is outlined in red. All you have to do is substitute your table name. If your table name has spaces you will need to use the single quotes like this, 'Table Name'
-
FYI, you won’t be able to copy from the image. You’ll have to select it from the first post on this page.
-
Thanks again. Here is what I entered (3 times) and received the ERR message
let prvId := number (last(select ‘Test table’) .Id) - 1; let newRec := this; newRec. (‘Start Miles’ := number(select ‘Test table’ where Id = prvId). ‘Stop Miles’))
-
The app requires this specific single quote style '
You can either copy & paste it in the place of the single quotes you have or press and hold the single quote key on your iPhone and you’ll see alternative quote styles. Zoom in on your phone and you can see the difference.
-
Thank you again. Who knew there were 4 types of quotes?
The code was accepted - it just didn’t work. Will keep trying before I give up and go back to my File Maker Pro v4.0 on my PC.
-
let prvId := number(last(select 'Test table').Id) - 1;
let newRec := this;
newRec.('Start Miles' := number((select 'Test table' where Id = prvId).'Stop Miles'))
-
Please copy & paste the code above or you can try adding another "(" between number and select. There should be 2. The code goes in "On create" like in the picture below...
-
SUCCESS!! Thank you for your perseverance!
-
And you as well
-
let prvId := number(last(select Jornales).Id) - 1;
let newRec := this;
newRec.(Fecha := text((select Jornales)[Id = prvId].Fecha));
newRec.(turno := text((select turno)[Id = prvId].turno));
newRec.(labor := text((select labores)[Id = prvId].labor)) -
Sorry
I have a question, if the value are fron another tables?
let prvId := number(last(select Jornales).Id) - 1;
let newRec := this;
newRec.(Fecha := text((select Jornales)[Id = prvId].Fecha));
newRec.(turno := text((select turno)[Id = prvId].turno));
newRec.(labor := text((select labores)[Id = prvId].labor))Thanks
Content aside
- 4 yrs agoLast active
- 28Replies
- 7973Views