Default values on the widget

Hello,

Is it possible to add default values depending on the widget?

If not, what are the solutions to obtain default values?

Thank you.

Hi there!

There are different ways to add default values. You can add default values if the widget updates based on what is selected in another. For example, our Influence Dashboard template has two several widgets that update based on what is selected in another. When you add a new record in the second widget, one of the fields defaults to what is selected in the first widget. I’ve made a a few edits to the template to reveal some hidden columns to show you. You can check it out at the link below.

https://public.getgrist.com/ga7SGFEXW7G8/Community-689/p/9

The table on the left is a summary table of the opportunities table, showing how many opportunities for each primary platform listed. If I select Instagram, the table on the right filters to only show opportunities where the Primary Platform listed is Instagram. If you were to add a new record in this table, the Primary Platform will automatically populate with Instagram.

You can also see this on the Influencers dashboard of the same template.

https://public.getgrist.com/ga7SGFEXW7G8/Community-689/p/6

Three of the widgets on this page update based on which opportunity is selected in the Opportunities table in the upper left of the page. If you add an interaction in the Interactions table, the Influencer name is automatically assigned based on whomever is selected in the Opportunities table. If I have Manny Garter selected in the Opportunities table then add an email interaction, Manny’s name automatically populates.

To link widgets in this manner, you can select which widget you would like to select by when adding a new widget.

We have a webinar on YouTube that walks through how to create productive page layouts that walks through building this template and linking widgets.

You can also add default values based on other fields. I added examples here:
https://public.getgrist.com/ga7SGFEXW7G8/Community-689/p/11

The first example is the 21+ column. I have added a formula so it is marked true if the person is 21 or older, false if they are not.

The next column is Contacted? that defaults to “No” when a new record is created. This is using a trigger formula. As soon as a new record is created, this is set to “No” but can be updated to Yes or Follow up when contacted.

The last is “Last Updated” column which defaults to the current time and date anytime a field is updated.

If this doesn’t cover what you are trying to do, provide more details into your use case and we can give more specific examples that will help.

Hello,

Thank you for all these answers that will bring to the community many possibilities.

My main problem is to get a default value in a field when creating a record. Without necessarily linking it to another field.

This is cruelly missing in Grist!

It would be really interesting to have a default value option for each type of field.

Example of what it would be possible to do:

In a workflow type of management, the status field cannot automatically get a default value (for example: in progress) when the form is created.

Unfortunately, when the record is created, these fields must be filled in each time and will always have the same initial value. This would make it much simpler and less work to operate.

Without this option, some unfilled fields will not appear in filtered widgets. This breaks the tracking.

If you have default values for when a new record is created, you can use a trigger formula to set that default value to apply to new records. For example, if you want ‘Status’ to default to ‘In Progress’ for new records, you would set the trigger formula = "In Progress" then check the ‘Apply to new records’ option.

When I added the record for Tom, the Status column defaults to ‘In Progress’ but I can still update it to complete.

If you record who is entering the record, you can also have that default to the user’s name. Here, I entered records for Joe and Tom. It automatically filled in my name in the Entered By column. It pulls the name associated with my Grist account, Natalie Misasi. This also uses a trigger formula that applies only to new records. The formula here is = user.Name.

Let’s say you have a department field and want to set the default to “Human Resources”. Under column behavior, select ‘Set Trigger Formula’.

image

It will prompt you to enter your formula. Enter the default value between double quotes. Here, my formula is = "Human Resources". The default setting for trigger formulas is to ‘Apply to new records’. Once you’ve set your default value, the next new record you add will have this default. I create a new record and Human Resources is filled in as the value for that column.
image

Many thanks for taking care to detail and give concrete examples.

Thank you for this excellent feedback. :clap:

In addition to me, I am sure that this intervention will help many people in the community.

Well done and thank you. :+1:

1 Like