CommunityHire an ExpertSign Up
Item DetailsUse Case: Hiding blocks based on current record data
Item Details

Use Case: Hiding blocks based on current record data

Hide blocks based on the currently selected record

Use Case

Not only can you change a block’s visibility based on the User Group that a logged-in user is in, but you can also control a block’s visibility based on a currently selected record. This is great for:

  • Showing different line item formats on an invoice depending on the deal type

  • Showing or hiding a request form based on the type of document being viewed

  • Showing or hiding different task views based on the project type or a project owners preferred task view.

  • Displaying different CTAs based on a selected record

  • …and much, much more.

Setup

In the example below, we want to conditionally show a request form, based on if a selected document is available to request or download. If the document has a file field that is not empty, we should only show a button to download and hide the form. If the file field is empty, we should show a form that allows end-users to request this file via email instead. This allows an administrator to track who has been given access to particular files and see how many times they have been accessed.

Hiding the Download Button

We need to hide the download button if the file field is empty. First select the block, go to the Actions tab, and select the Download button. Then click on the little branching icon in the button settings:

Notion image

Once open, we can toggle on the “On Specific Records Only” button and setup some rules to hide the button if the File field is empty.

Notion image

Hiding an entire block based on current record data

Since the item details block is showing only one specific record, we can use that record’s data to determine whether or not to show other blocks on the page. For our example, we want to hide a Request Form if the File field in our database (you may have other fields and field names you want to use).

First, select the block, then click on the Visibility tab and turn on the “Hide if” toggle. Setup your rules, which in our case should be If the File field “Is not empty”.

Notion image

Use these docs with your AI tools

An AI agent can read this documentation directly. You do not need an account or an API key. Everything here is public and read-only.

Query these docs via MCP

Recommended

Add this server to Claude, Claude Code, Cursor, Mistral, or any tool that supports MCP. Your agent can then search Softr Documentation documentation and read it in full, instead of answering from memory.

https://docs.softr.io/mcp
  • searchFind the passages that answer a question.
  • fetchRead one page in full, as Markdown.
  • list_pagesSee every page in this documentation.

Query these docs over HTTP

The same tools also work as plain web requests. Use this for scripts, or for any tool that does not support MCP. There is one endpoint per tool. Arguments go in the query string, and the answer comes back as JSON.

https://docs.softr.io/api/docs/search?query=custom+domain

Read the OpenAPI description. It is built from the same definitions as the tools, so it always matches what the endpoints do.

Read these docs as Markdown

Add .md to any page URL to get its Markdown source. You can also send the headerAccept: text/markdown to the page URL itself.

To read the whole documentation in one file, open llms-full.txt. For a short index of every page, open llms.txt.