Hi All,
I have a Paragraph field in the grid, which i have limited to 500 char, but i want to show the count of characters below the paragraph, for that am using Instructions,still with no luck,
Can anyone please help me on this,
a!paragraphField( value: fv!item.comments, saveInto: fv!item.comments, height: "SHORT", instructions: "Number of characters " & len(fv!item.comments) & "/500", refreshAfter: "KEYPRESS", disabled: if( local!accessoftheGroups = cons!CMP_GROUP_ACCESS_VALUES[2], true, false ), validations: if( len(fv!item.comments) <= 500, "", "500 characters maximum." ) )
Thanks in advance
Warm Regards
Vineeth
Discussion posts and replies are publicly visible
Sharing this sample code it will help you
a!localVariables( local!para, a!paragraphField( value: local!para, saveInto: { local!para, }, height: "SHORT", instructions: "Number of characters " & len(local!para) & "/500", refreshAfter: "KEYPRESS", validations: if( len(local!para) <= 500, "", "500 characters maximum." )))
For Grid you cannot show instruction
Thank you Gaurav, is there any way i can achieve showing the count of characters
Either you can give some additional field in the right side to show the count but that's not at all recommended.
Other thing you can try is give one text field on top or bottom in readOnly format just to display the length of paragraph you are currently working with...here you will need one extra local variable to store the length of the filed and that you will use as value in the text field
Appian 21.1 includes this OOTB.
Agreed with Stefan - what version of Appian are you on currently?
its an 20.4
Ok then - this new feature was released in 21.1, so you'll be able to enable this to show up inherently directly in the paragraph field as soon as you can upgrade. Until then I'm not sure there's all that much you can do.
Until the upgrade, I can only suggest utilizing the validation parameters on both the paragraph fields and on the grid itself - this will show hover over on the paragraph field as well as line by line errors underneath the grid. Additionally, you could add a skinny column next to the paragraph field for a length display - but as the others have noted here, this is probably about the best you can do until you upgrade.
a!localVariables( local!data: { {field1: ""}, {field1: ""} }, local!maxLength: 500, a!gridLayout( label: "Grid", headerCells: { a!gridLayoutHeaderCell(label: "Field 1"), a!gridLayoutHeaderCell(label: "Validation") }, rows: a!forEach( items: local!data, expression: a!gridRowLayout( id: fv!index, contents: { a!paragraphField( value: fv!item.field1, saveInto: local!data[fv!index].field1, required: true, validations: { if( len(local!data[fv!index].field1)>local!maxLength, concat("Please enter less than ",local!maxLength," characters. Current length: ",len(local!data[fv!index].field1)), null ) } ), a!richTextDisplayField( value: { a!richTextItem( text: concat("Length ",len(fv!item.field1),"/",local!maxLength), style: "EMPHASIS", color: "SECONDARY" ) } ) } ) ), validations: { reject( fn!isnull, a!forEach( items: local!data, expression: { if( len(fv!item.field1)>local!maxLength, concat("Please enter less than ",local!maxLength," characters in line ",fv!index,". Current length: ",len(fv!item.field1)), null ) } ) ) }, addRowLink: a!dynamicLink( label: "Add a Row", saveInto: a!save(local!data,append(local!data,{field1: null})) ) ) )