Skip to content

updatePropertyFromPrompt(value)

The updatePropertyFromPrompt function will return a link that when clicked will prompt the user to enter a value. The user can then enter a value and the property will be updated on the file.

markdown
```qatt
query: SELECT TOP 1 updatePropertyFromPrompt('Enter email alias', frontmatter->email, path, 'email') AS updateEmail FROM obsidian_notes
template: |
  {{#each result}}{{updateEmail}}{{/each}}
```

will result in:

text
<a class="qatt-link" onclick="const fun = async() => { let newValue = (await _qatt.ui.promptForInput('Enter alias','alias',false,false));if(newValue !== null &amp;&amp; newValue !== undefined ) {app.fileManager.processFrontMatter(app.vault.getAbstractFileByPath('contacts/person.md'), (f) => { f.email = newValue; });}}; fun();">alias</a>

The links by default will be dotted and not underlined. This can be changed by adding a snippet for the CSS class qatt-link to a CSS file.