Discussions

Expand all | Collapse all

Copy all data from one field into another field within the same table

  • 1.  Copy all data from one field into another field within the same table

    Posted 02-01-2018 08:27
    Trying to create a key field in a table that has not unique ID. Thought I could create a Formula-Text field to combine Lat and Long. Then copy this combined value into a new field and use the new field as a Key field.


  • 2.  RE: Copy all data from one field into another field within the same table

    Top
    Contributor
    Posted 02-01-2018 11:29
    Key fields must be unique. I can't reconcile your title with the body of your message - they seem  to be talking about different issues. Clarify.


  • 3.  RE: Copy all data from one field into another field within the same table

    Posted 02-01-2018 12:01
    Reason I am copying is so I can use the new field I copied into as a key field.


  • 4.  RE: Copy all data from one field into another field within the same table

    Posted 02-01-2018 13:32
    Ruby,

    In fact the best solition for your lat/ long issue is to make a formula field to concatenate the lat/ long together like 123-456. I think you have that already done.

    In fact, a little known secret is that a formula in fact can be the Key field to a table. You just need to type in the API call by hand into your browser.

    Just get to the table and after the ? Hand type

    act=API_SetKeyField&fid=99

    When 99 is the field ID number.

    You can double check the syntax in the API help guide, but I think that is it. I would turn off App tokens when you do that or else you would need to supply one to make that change

    Then you don�t need form rules to copy across a formula to a text key field!


  • 5.  RE: Copy all data from one field into another field within the same table

    Posted 02-01-2018 17:04
    I will try it. Thanks.
    I didn't concatenate because I was worried at some point the combined value would no longer be unique. How many decimal places to strip off? I have the entire Long and Lat value in there separated by a space using the List function. Reason I used space and did not use another symbol like  - or / is when I exported to CSV, then I noticed it changed the value of the combined data to some single value (like it was doing a calculation).


  • 6.  RE: Copy all data from one field into another field within the same table

    Posted 02-01-2018 17:17
    I can't really suggest if you would want to strip off decimals.  It's a text field, so text is text it will not truncate or round) and they will be unique if they are even a tiny bit different. I guess it depends on your application needs as to how many decimals to maintain.


  • 7.  RE: Copy all data from one field into another field within the same table

    Posted 02-01-2018 17:53
    You are brilliant! Thanks.

    Steps I took:
    App settings: App Properties>Security>I clicked on Manage tokens but no tokens listed. Then I unchecked the box Require Application Tokens.
    At the table I typed in act=API_SetKeyField&fid=33 after the ? and removed the "a=td" but got an error so I changed act= to a=

    It worked! I looked in my Table, that field has been set to be the Key field.

    Do I need to worry about the security concern from not requiring app tokens?


  • 8.  RE: Copy all data from one field into another field within the same table

    Posted 02-01-2018 17:56
    The only reason I suggested to turn off App Tokens was so that when you hand typed that URL once, you didn't not have to also  type &appoken= xxxhedqkurfkhndjdksk

    Feel free to turn to back on now that the Key field is changed. 

    I hesitate to advise on this forum whether you should or should not leave them enabled.  It is an extra layer of security.


  • 9.  RE: Copy all data from one field into another field within the same table

    Posted 02-01-2018 18:38
    Thank you once again for the solid advice. Your experience carries a great deal of weight. I will turn it back on.