Help

Re: Prefill when duplicate records present

Solved
Jump to Solution
1091 1
cancel
Showing results for 
Search instead for 
Did you mean: 
CharlieMullin
7 - App Architect
7 - App Architect

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

1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

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. 

See Solution in Thread

2 Replies 2
kuovonne
18 - Pluto
18 - Pluto

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. 

Thanks, kuovonne, that worked perfectly, although I don't understand why it worked. Here's the updated code portion:

    CONCATENATE(
        "?prefill_" & ENCODE_URL_COMPONENT("Asset to Update"),
        "=" & ENCODE_URL_COMPONENT({Asset Rec ID} & "")
How does the code know that I want it to put the value found in the Asset Name field into the form, when I'm referencing the Record ID in a Rollup field?
 
I'll read up more about Rollup fields and the difference between ARRAYJOIN and ARRAYUNIQUE.
 
Thanks for your help!