How to add a form

Former Member
Former Member

How can I add a form to a page using User Profile Fields as elements and having a submit button?



-
[edited by: ibrahimk at 4:16 PM (GMT 0) on Thu, Jun 4 2020]
Parents Reply
  • Former Member
    0 Former Member in reply to Ben Tiedt

    I have some questions:

    1. What do you mean by 'non-selectable inputs'?

    2. What URL would the form post to ?

    3. How would the field values be retrieved from the database? Can they be in their own custom tables?

    If you could provide a bit more information about the structure of the form, that would be appreciated..

Children
  • 1. What do you mean by 'non-selectable inputs'?

    When defining the profile fields, do not identify them as having selectable values, instead, choose "Plain Text" or "Number" as the data type. Because the selectable values will not be defined with the profile field, the profile field itself will not be able to validate the selection is valid, so the field should not be defined as selectable.

    2. What URL would the form post to ?

    The form itself is HTML+JavaScript+CSS. You could implement the save in JavaScript and save values to the REST endpoint 

    URLs POST (Header: PUT) api.ashx/v2/users/{id}.xml (or .json) UPDATE a user by user id. POST (Header: PUT) api.ashx/v2/users/{lookupusername}.xml (or .json) UPDATE a user by username. Request Parameters…
    Last edited in Verint Community 11.x > API Documentation

    passing the values in the same format outlined above ( _ProfileFields_FIELDNAME = 'FIELDVALUE' ).

    3. How would the field values be retrieved from the database? Can they be in their own custom tables?

    How you populate the selectable values would then be up to you. You could define them in javascript or load them from the database (either way you're maintaining those options and how to present them). There are not APIs to support interacting with the database directly, however, so you'd need to implement your own APIs ( see https://community.telligent.com/community/11/w/developer-training/65065/widget-extensions to create a script/widget extension or https://community.telligent.com/community/11/w/developer-training/65113/exposing-data-to-external-sources to create a REST endpoint to consume via JavaScript on the client side) to either expose the options to scripts/widgets or to the client browser via REST.

    If you could provide a bit more information about the structure of the form, that would be appreciated..

    The form itself would be HTML+JavaScript+CSS. Generally, this would consist of a custom widget where:

    • the Content of the widget is the HTML rendering of the form, including the <form> tag, using Velocity syntax to load existing values from the accessing user's profile fields and including javascript to automate the client behavior of the form and save it
    • the JavaScript would automate the behavior of the form -- adjusting select box options based on other fields (as your custom logic requires). When submitting your form (via a button or other input that you define handled by JavaScript), the JavaScript should collect the values from the form and submit them back to the Community by calling the update User REST endpoint.