Field editing and validation
Asked by Jim Fancher:

Hi,

New user here. I want to do some field validation on table cells and am experiencing something unusual (or maybe not).

I create a new variable ($status) for the table cell and chose list and then listed the four choices.

What i'm experiencing when I create the page (from template containing the $status variable) is that it's a seemingly twp step process. The first screen that comes up contains my template with all fields and the only ones editable are the fields with variables (like $status). I have to hit next button (which presents a normal page ) to be able to change or fill in all other text data. Then I hit Save to create the page.

I really just want one screen to fill in all information and when I get to the $status cell I want to select the choice from the list. Then hit Save to finish the page creation.

Is there some settings or options I can use to change this? My users don't really know they can change those fields on the first screen and that they have to hit "Next" to get to the rest of the form data. it's really confusing.

Thanks for any advice,

Jim


Answers:
author: Bill Bailey
body: Once the variable is set, does it ever change on the created page?

If so, I would restructure your solution as a user macro that has a number of drop downs (if your form can be structured that way). Then you can control and validate entries, and conceptually it is easier for your users (plus easier to update the form later).

comments: author: Jim Fancher
body: Hi Bill, thanks for the response.

Yes, the variable will change as it is a status indicator. I need other users to be able to update it accordingly. Is the user macro hard to create? Does it require coding? And will it alleviate the issue with the two screen process to fill out the form?

Thanks,

Jim


author: Bill Bailey
body: Yes, the macro will allow users to simply edit the macro in a page, and change the status. You can have the macro inserted in the template, but it settings can be change anytime anyone edits the page.

User macros are not hard, but do require coding, specifically, using Velocity (VTL) which supports JAVA constructs.

There are a number of resource that can start you on the process:

<https://confluence.atlassian.com/doc/writing-user-macros-4485.html>

If you can be a bit patient, I want to write an article to talk about this type of application. Hopefully a series of starter guides to user macros (but more complex than Hello World examples).


author: Jim Fancher
body: Thanks Bill, that's very helpful. An article would be great. I've since redesigned page to not use Macro's but I don't like how it works so definitely looking forward to some instructional resources.

Thanks again,

Jim


author: Bill Bailey
body: [@Jim Fancher](/t5/user/viewprofilepage/user-id/1899533), I banged out an article this weekend, exactly around this topic. Please take a look:

[Getting Started with User Macros - Writing a Wrapper Macro](https://community.atlassian.com/t5/Confluence-articles/Getting-Started-with-User-Macros-Writing-a-Wrapper-Macro/ba-p/979571)

Feedback would be appreciated.


Tags: cloud

confluence-cloud

field