FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
98 stars 17 forks source link

Can't set form fields in page's action block #2867

Closed r-miljons closed 4 days ago

r-miljons commented 1 week ago

Has your issue been reported?

Current Behavior

If you have actions that set form fields and want to save yourself from tracking down every single place on a page where you are using said action by creating and action block... currently it's not possible, because "set form fields" action doesn't show up as a choosable action in the action block view. Please fix because it will save a lot of wasted time and headaches from tracking duplicate code in multiple places!

Expected Behavior

Action block should contain "set form field" as a choosable action

Steps to Reproduce

Try to create an action block with a "set form field" action!

Reproducible from Blank

Bug Report Code (Required)

IT48lvLl8c9goelG+KX6ccFvmiMUKUc7bY03kutTcxM8J5jbP4Ycf/fRUFtUcO6qSlZ2J2D9inIX/MrviuLxG8EDNRyuRoQ5wbhcYQrjVni5b4ywPr63b3JRHd1XfVCP1p+ngB5AVbFhW1oh2lyqGNmAfz7bGIzEPVUBMeaoXdeK2SrDX1iXc2URm05KZDPz

Context

Please fix because it will save a lot of wasted time and headaches from tracking duplicate code in multiple places!

Visual documentation

no need

Additional Info

No response

Environment

- FlutterFlow version:  4.1.48
- Platform: Windows
- Browser name and version: -
- Operating system and version affected: Windows 11

General

Relative to the time the changes were made, data was lost within

When following my steps to reproduce, data loss happens

ignalauret commented 1 week ago

Hey @r-miljons thanks for your report. Because the App Action Blocks can be used anywhere in the app, it makes sense that they should not be able to modify the state of the Widget (for example setting a Form Field).
However, I think it could be possible to enable this feature for the Page action blocks. I will send a request to our Technical team so they can let us know if it's possible to implement this or not.
For now, I would suggest you to create an Action block that generates whatever you need to set on the Form Field, and return it as output. This way, you can use everywhere the Action Block that generated the output (and modify it everywhere at the same time) and then have an action that Sets form field with that value. This last one shouldn't change if you change your logic, so you shouldn't need to check in every place you are using it if you change your action block.
I hope this was helpful, the technical team will update you in this thread when they have an answer. Have a great day!

ignalauret commented 1 week ago

The technical team has confirmed that is possible to implement the Set Form Field on the Page Action Block, so I'm creating a Feature request for this. Sadly that's not available right now, so I hope my workaround was helpful. They will let you know on this thread when the feature is available. Have a great day!