Skip to main content
Question

Can a formula text field be used as the table's key?

  • August 11, 2014
  • 0 replies
  • 285 views

Forum|alt.badge.img+4

I have a formula text field that I want to use as my table's key, however the option is not available to me. Can formula fields not be used as the Key? Note: values in that formula field are and will always be unique.

Thanks in advance.

Juan

This topic has been closed for replies.

No, the Key field must not be a formula.

An alternative is to have your form show the calculated formula and then have a Form Rule that says "when the record is saved, change the value of [my key field] to the value in he field [my key field formula]".

But then you will also probably want a safety net to subscribe to where the Key fields does not equal the formal field.

Forum|alt.badge.img+4
Thanks Mark.  The issue is that ALL the records in this table will be imported rather than directly imputed via a form.

If all the records are being imported, them import them with the Key field calculated.

If the source data is not flexible, then import to an Excel Template to add the calculated the Key field and then import to your app.

  • Registered
  • June 1, 2019
I have a similar situation. In my case, I'm not using a form or importing the records. The records are created by the Copy Master Detail button... but I want a formula field to populate the key field when the records are created. Any ideas?

There is an API to set the key field which can simply be hand typed into the URL address bar. It does allow for a formula field to be the Key field.

But you would be in somewhat uncharted territory as I�ve never seen any documentation that this is OK to do. I was just told about it an an EMPOWER breakout session.

You would have to make a copy of your app to test that.

Forum|alt.badge.img+14
I have done this on many occasions and use the API in the URL bar to set this.

?a=API_SetKeyField&fid=X&apptoken=catjbq7277cyecb3vh95zdqgi5


Hey folks - thanks so much for your question, and for the comments and answers!  We noticed the discrepancy between the UI and the API around this issue, and had some concern about possible data integrity issues resulting from that.  Data integrity is a critical issue to us, so we've made a change that will make the API behave the same as the UI - it will no longer be possible to set formula fields as keys via the API.  That should appear in an upcoming release.