An upgrade on this feature request would be to be able to add dynamic airtable content into labels. i.e. as I am creating a marketplace I want to be able to welcome them by there business name which is a column in my airtable.
But where I have put the ****, it would be great to be able to add in dynamic airtable content. In the scenario I would want to add the name of the business who listed the class.
Got it. I wasnāt sure if you meant labels on filter settings, labels on data fields, or both.
I know how to write this custom code but Iām afraid this is a tough time of year to find the time. Iām making notes to myself here so I can come back to it later, or maybe someone else will take a crack at it.
The basic approach is this:
In the studio, annotate your labels with {{fieldName}} annotations. So in your example, assuming your Airtable field was called āBusiness Nameā, youād type More Activities from {{Business Name}} into the Label field of the Filter Settings.
In a custom code block, write code that does this:
ā wait until the label has been added to the DOM of the page. If itās a data field label, we have to wait until the Airtable record has been fetched from the server.
ā search through the page DOM for text that looks like {{fieldName}} using code similar to var i = document.evaluate("//p[contains(., '{{Name}}')]", document); n = i.iterateNext(), and for each one found, extract the field name from between the double curly brackets with code similar to var propName = n.innerText.match(/{{(.*?)}}/g)[0], then look fieldName up with fieldValue = window.records[keys(records)[0]].record.fields['fieldName'] and replace {{fieldName}} with that value with code similar to node.innerText.replace(/{{(.*?)}}/g, fieldValue)
Yes, being able to add dynamic content into field labels and within text blocks would be incredibly useful and offer a more personalized user experience. The ability to create content block templates that merge field values into a text template, especially in combination with form fields or a signature block would be amazing for workflows that require approvals.
Hi @dcoletta and @Anna,
I hope youāre both doing well
Did you end up figuring out a way to add a {LOGGED_IN_USER:NAME} in another block type than Custom Code (e.g. Hero blockās title)?
Welcome to the community! At the moment, you can access the logged_in users fields. You can confirm what fields you have access to by adding a custom code block on the page, and typing in āLogged_in_userā - from there the available fields will show in the dropdown for you.
However, itās limited to that at the moment. We understand the need to expand this, and have it in our plans, but canāt give a date on when it might be released at the moment.