FieldPreValueSourceType - async GetPreValues
During development of a feature we came across PrevalueSourceTypes. These things complete cover our needs to provide custom data.
However we noticed that the GetPreValues function only available is in a Synchronous manner. We would like to see an asynchrounous option to be able to use async/await for getting data which we require.
In Umbraco it's becoming more and more common to use asynchronous notificationhandlers etc. Is this something we can expect in the (near) future.
Hi Wiebe! We've started gradually making the Forms API more async in each major version. Currently the controllers rendering/handling the form submissions, the views/components and the execution of workflows are all async (which are all called on each form render and submission, aka the 'hot path').
As you've discovered, the FieldPreValueSourceType doesn't have async support yet. However, the returned values can be cached since Forms 10.5+, as you can see in the updated screenshot in the v14 documentation. Can you give more context on why this would be beneficial in your specific implementation (what custom data are you requesting)?
Internal note: have created work item 43587 to include this in the update to Forms 15.
This method and some other appropriate ones will be asynchronous from Forms 15. The release candidate for this is expected next week.