Unable to persist the state in Forge Macro Config

Xin Quan Teoh
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 4, 2024

Recently i'm implementing a dynamic form in macro config in Confluence Forge app and encountered a weird behaviour in macro config.

The columns select field options are retrieved via resolver function to fetch all the available property columns based on the Type field. The initial state of the columns is empty array ([]), this is why you would see `No options` at first.

Screenshot 2024-09-05 at 10.50.09 AM.png

After the resolver invocation has been executed in useEffect, the Columns select field has been filled up with the result from resolver.

Screenshot 2024-09-05 at 10.50.19 AM.png

However, when i try to select the next column, the macro config somehow reset the state to init state and the Columns select field became 'No options' again

Screenshot 2024-09-05 at 10.56.49 AM.png

Therefore, i would need to go through the fetching process again to fetch the available properties.

Screenshot 2024-09-05 at 10.57.05 AM.png

I would like to know is it an expected behaviour for macro config in forge? Seems like it impact the user experience where the user has to wait for the fetch for every option selection.

1 answer

0 votes
YY Brother
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 4, 2024

Hi @Xin Quan Teoh 

Welcome to our Community.

Please check your Forge codes in Select onchange function. According to what infromation you've provided, the options got from the Server side is okay, but have issues when you select some of the options.

Hope it helps & Good luck

YY哥

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events