0

Question

Can you setup a autofill finish from previous entries

28 replies

null
    • Emanuel_Neubert
    • 5 yrs ago
    • Reported - view

    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

    • Bill_Ives
    • 5 yrs ago
    • Reported - view

    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

    • Bill_Ives
    • 5 yrs ago
    • Reported - view

    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

    • Sean
    • 5 yrs ago
    • Reported - view

    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.

    • Nick
    • 5 yrs ago
    • Reported - view

    @ Bill

    No, there is not such a feature like Filemaker's "Auto-complete using existing values" in Ninox (for now).

     

    Nick

    • mike
    • 5 yrs ago
    • Reported - view

    @ Emanuel, @ Sean,

    I like your solutions for autopopulating fields. Handy and clever!

    • Sean
    • 5 yrs ago
    • Reported - view

    😁

    • Bill_Ives
    • 5 yrs ago
    • Reported - view

    Thanks everyone. 

    • aztory
    • 4 yrs ago
    • Reported - view

    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. 

    • Sean
    • 4 yrs ago
    • Reported - view

    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.

    • aztory
    • 4 yrs ago
    • Reported - view

    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. 😜

    • Sean
    • 4 yrs ago
    • Reported - view

    😆 Try to copy/paste the code and replace YourTableName with umm, well, you get the idea!

    • Sean
    • 4 yrs ago
    • Reported - view

    FYI, the single quote must be this type => '

    • aztory
    • 4 yrs ago
    • Reported - view

    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?

    • Sean
    • 4 yrs ago
    • Reported - view

    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'

    • Sean
    • 4 yrs ago
    • Reported - view

    FYI, you won’t be able to copy from the image. You’ll have to select it from the first post on this page.

    • aztory
    • 4 yrs ago
    • Reported - view

    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’))

    • Sean
    • 4 yrs ago
    • Reported - view

    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.

    • aztory
    • 4 yrs ago
    • Reported - view

    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. 

    • Sean
    • 4 yrs ago
    • Reported - view

    let prvId := number(last(select 'Test table').Id) - 1;
    let newRec := this;
    newRec.('Start Miles' := number((select 'Test table' where Id = prvId).'Stop Miles'))

    • Sean
    • 4 yrs ago
    • Reported - view

    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...

     

    IMG_0383

    • aztory
    • 4 yrs ago
    • Reported - view

    SUCCESS!! Thank you for your perseverance!

    • Sean
    • 4 yrs ago
    • Reported - view

    And you as well 😄

    • lvs1973
    • 4 yrs ago
    • Reported - view

    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))

    • lvs1973
    • 4 yrs ago
    • Reported - view

    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
  • 7946Views