Possible to hide/show blocks based on record attributes that are pulled from the page?

The use cases outlined in these two topics are crucial to some functionality on my site:

However, it seems there may have been some recent updates which affected the functionality here.

What’s the correct way for me to pull an email from a field called “revieweremail” in the “#list-details10” block?

I would then compare it to the logged in user email obtained from: const loggedinEmail = window[‘logged_in_user’][‘softr_user_email’]; and show/hide blocks based on this.

It seems very simple to me but I’ve spent well over 10 hours debugging this to no avail. Any help would be greatly appreciated!!

Hi @gabeski , given the changes in architecture, I think your best option is to use @artur 's snippet here

You’d need to have your “revieweremail” field included in the block (it can later be hidden from view with some custom code on the page), and you’d use that in lieu of “fieldName” in Artur’s example. “YourValue” would be your LoggedInEmail and the forms any item that you want to hide based on that condition.

If that doesn’t work for you, let us know, we can try to debug it together.

Hi Julien,

I was able to get this to work! Artur’s snippet worked and the visibility works, allowing for dynamic CTA blocks for both parties of the transaction. I am however getting the following error every time I load the page (even though the recordID is valid and the visibility is working). Thoughts on what may be causing this? Happy to share the code as well.


Hi @gabeski , it might be unrelated to your custom code but I’d have to check the logs to be sure. You didn’t have that error before ? Does the recordID that is mentioned match the recordID of the item you’re showing the details for ?

Hey Julien, that’s right it did not have the error before (page which has the same implementation does not show this error), and the recordID is correct. Is there really any need for it to be looking up this recordID if the information is on the page?

@gabeski is the link shareable so we can check the error ? or is it gated one ? The error I read seems to be base/table mapping issue when record from list is being passed to a detail page but detail page is mapped to another base/table hence the record is not found.

Artur, that’s exactly it. The record being passed is a UserRecordID, but the page is a details page for a different type of record (which the user can create). Is there any resolution to this? Perhaps a short script that tells the error message not to show?