Apr 21, 2023 02:31 PM
In the following top portion of my pre-fill code, everything works fine except when there are duplicate records in the Asset Name field.
All the other pre-filled items work fine. But when there are duplicate Asset Name values, the form displays nothing in the Asset to Update form item.
This duplication is expected and I was thinking I should somehow refer to the Record ID as well so the code will grab to correct record:
CONCATENATE(
IF(
"Prefilling [Update Asset] view in [Assets Updates] table in base with id 'appZyoL5fNNYcN6dv'",
"https://airtable.com/shr7hLXk437tBSfOb"
),
CONCATENATE(
"?prefill_" & ENCODE_URL_COMPONENT("Asset to Update"),
"=" & ENCODE_URL_COMPONENT({Asset Name } & "")
),
CONCATENATE(
"&prefill_" & ENCODE_URL_COMPONENT("Original Module"),
"=" & ENCODE_URL_COMPONENT({Module COPY} & "")
),
What code should I use to clarify the Asset Name to pre-fill when there are duplicate Asset Names?
Thanks for any ideas.
Charlie
Solved! Go to Solution.
Apr 21, 2023 09:59 PM
In your Assets table, have a formula field that shows the RECORD_ID(). Then in the linked table, use a rollup field that rolls up the formula field with the record ID. Use the formula ARRAYJOIN(values, ","). Finally, prefill with the rollup field.
Apr 21, 2023 09:59 PM
In your Assets table, have a formula field that shows the RECORD_ID(). Then in the linked table, use a rollup field that rolls up the formula field with the record ID. Use the formula ARRAYJOIN(values, ","). Finally, prefill with the rollup field.
Apr 23, 2023 03:46 PM
Thanks, kuovonne, that worked perfectly, although I don't understand why it worked. Here's the updated code portion: