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)?