When adding a new record to a linked dynamic view - set default option with current record

Hello Softr Community -

I have been enjoying implementing the action buttons on to my blocks, and although there are some tweaks still needed as they roll out, there is one function I wanted to flag.

I have a table block that is connected to a linked field being pulled from a list-details block. The table therefore only shows the record that is in the list details block and was originally chosen from the list block.

List Block → List Details → Table (linked records)

The update action buttons nicely link to the record it’s next to and is pre-filled. However, I would like the ADD ACTION button to also connect to the record that the table is filtered by so when I add a new record to the table, the parent record is pre-filled so the user does not have to go back or scroll through hundreds of records (or choose something they don’t have permission for).

Any thoughts on making this work, or is this a feature request?

Thanks!

Hi @SAS_AT
At the moment it’s not possible to achieve with the action buttons, since they don’t have a hidden field in the settings.

But I would suggest creating a Form block on the same page with the List details block and grab the recordID of the List details record with the hidden field, as a result the users won’t need to select it from all the fields.

If you want to keep a nicer UI (open a Form in the modal from the Table block), here is what I would suggest doing:

  1. I would create a new page with a Form block that you would like the users to be able to submit with hidden fields to grab the recordID of the List details item too. Since the Form block is on the new page, we need to add a recordID to the URL to the Form block, so the hidden field works. Here is how I would do it →

  2. On the Airtable table to which the Softr Table block is mapped, I would add a Lookup field and would bring the recordID of the List details table.

  3. I would create a new Formula field with the Concatenate formula with the following logic:
    CONCATENATE('https://YourSoftrApp.softr.app/Path_to_The_Form_page?recordId=', Lookup RecordID (from the List details table))
    Where instead of
    https://YourSoftrApp.softr.app → use your app domain
    Path_to_The_Form_page → use the path to the page where the form block from step 1 is created
    Lookup RecordID (from the List details table) → Is the lookup field with List details recordId from Step 2
    As a result each item that should be shown on the Softr Table block will generate a URL to the Form with a recordID with the corresponding List details item

  4. Then I would create an Open URL action button on the table block and would map it to the URL generated with Formula from step 3

As a result you would be able to open the Form in the modal that will collect the hidden field of the List details item the Table block is located on.
Hope the description makes sense.

1 Like

@Viktoria I’ve used this workaround a few times myself. Any indication that hidden fields will be added to action buttons in the foreseeable future?

1 Like

@RyanRad they should be added within 2 weeks, if everything goes as planned :slightly_smiling_face:

3 Likes

Game changer… love the update.

1 Like

Hi Viktoria - thank you for the thoughtful and thorough response.

This is a great idea. I think @RyanRad took my thought as well - which is what if I wait until the hidden field option is launched and then I don’t have to build out this whole form process?

I might try this out and if it’s quick and easy, I’ll use it until the hidden fields open - which will be amazing to have.

Thank you!

Quick question - I want the button to only appear once at the top of the table, like the “New Record” action button. @RyanRad - do you have a screenshot of your workaround? I don’t want the add button to show up on each item on the table, but only once at the top of the table.

Let me know also @Viktoria if I am reading your workaround correctly - trying to picture this.

Thanks!

@SAS_AT not entirely sure If I’m understanding your question correctly, but you should be able to just create a top action button to open URL and utilize the same URL outlined by @Viktoria

@SAS_AT To be honest, it’s not possible to add this kind of button on top of a Table/List block, since the Topbar button Open URL action can’t be dynamic, thus it won’t be changed depending on the List details item.
I would suggest using the Item button and add the button for each item on the Table block.

Ah yes - I would not want to add the ADD button into the table block for the task table (since it’s to add a new task to the parent project) but I could add a button to add a task to the list details block above the table which can be a dynamic URL, and remove the add button from the table and then update the table when the hidden field option is added.

Does that make sense?? Thanks for helping me think through it!

@SAS_AT Yes, it totally makes sense, in my opinion, I think it might be achievable

1 Like

@Viktoria - having some trouble with the hidden field and figuring out how to connect it. The code for URL parameter is not listed in the documentation

Also, a pre-filled field is also ideal for me here - is that possible? I am having trouble with the formula.

Can I pull in the record and also pre-fill the field? One hidden field for “Project” and one field that is already completed with the project name?

Thanks

@SAS_AT would you mind sharing some screenshots in DM so I make sure we are on the same page.

Meanwhile, the parameter for the URL parameter is recordId.

@Viktoria - Update: I was able to make this solution work! However, I think there is an easier way, combining the simplicity of both your options. Have the form on a new page but also include a list-details block to pull in the record, which also enabled me to bring in data from the linked project

I found this accidentally because I wanted not only to connect the form to a record, but also pre-fill that record name at the top of the form. Your team made the suggestion for the details block on the form page to add the name and then I realized I could use a direct button link from the record page list-details block to the form page with the list-details block and it would pull in all the record info without a custom URL, and all I still needed was the hidden field.

Thank you!

1 Like