I think we should be able to set a variable (“field_name”) to type “text” and then in a backend workflow make changes to a thing and set the field to be updated by using the dynamic “field_name” variable and then set the value. This will prevent backend workflows with many conditionals. I am sure this would be beneficial in other locations as well and tha aim is to cut down on conditionals. For example in a reusable element if we want to build our own button to click and make changes to a thing. Right now we have to add loads of conditionals on which field to update when we could just have an exposed state of field name and an exposed state of value and then the reusable element workflow could be when clicked make changes to the data type update the dynamic field with the new value.
Can you give a specific use case?
Often, if you’re having to conditionally specify a field to modify, that’s a result of inefficient building.
Take an Order, with fields orderDate, dispatchDate, deliveryDate, returnDate. There’s a good chance you’d find it a lot easier to have an Order Update data type with a date, Order, and Status field and save them as a list on the Order. Then, you just edit Order Updates:filtered (your status type) : first item.
The one thing I could see this definitely being useful for is having a reuseable input and button, but autobinding kind of solves most of that already!
If we can come up with specific use cases then it’s more likely to be implemented
Yea we made our own custom toggle, very simple and probably common use case. We use toggles throughout to update either user settings or for customers answering questions. Simple boolean triggers. The issue is you cannot have it as a reusable element without either adding loads of conditionals for which field you want to update or adding loads of Do When workflows on the pages the element is used.
Also we have some webhooks connected and use them to save different dates based on status sent through the webhooks. Right now we have to conditionally check if the status equals this then update this specific field. I have an option set of Statuses and wish I could add a field on the option set for field name and then I could just say make changes to thing statuses field equals value sent.
How have you done it?
I have a reuseable toggle and just have a Do when condition is true and that’s all I need.
When it’s clicked, reset it’s clicked state and update the relevant thing. Same level of effort as just putting a native checkbox with autobinding.
Yeah, so that’s a good use case for having a separate data type that will mean you don’t have to repeat yourself.
You can aways use the Data API to do this.
I don’t know why I didnt think of that. I still think it would be nice for most users to be able to dynamically set a field to update but this does solve my issue pretty well. Instead of making change to thing I will just set up a call to update one of my data types in the api connector and make the field and value 100% dynamic.