Short question:
Is it possible to render a "choice-field" with the "fill-in" option as a regular choice field?
Long explanation:
My use case:
I'm in the process of migrating an existing MS Access database to SharePoint and converting the associated forms to Plumsail.
The database contains many lookup fields.
However, the author of the database did not work with ID as the primary key, that is to say: with the lookup fields, the value of the chosen option is stored in the field, and not the ID of the chosen option.
I could make the original database relational, but this is not only a lot of work, it also involves all kinds of queries and workflows.
So the idea now is to work for the form in Plumsail with:
- a choice field with the option "Allow 'Fill-in' choices: Yes"
- In SharePoint, the definition of this choice field contains only one option. A dummy value, e.g. "-"
- when opening the Plumsail form, the values of the source list are retrieved using PnP and the options of the choice field are overridden using something like
fd.field(fieldName).widget.dataSource.data(myOptions);
That way I have simulated a "lookup" field in SharePoint, but where the value of the option is also written in the field instead of the ID.
So far, so good.
The only disadvantage of this way of working is that a user can also fill in other options themselves. After all, the definition of the choice field says "Allow 'Fill-in' choices: Yes".
But if I disable this option, I can't save a chosen option in the field (because the chosen option is not part of the SharePoint definition of the choice options, and you receive the error message "The text you entered isn't an item in the list.")
So ideally, my "SharePoint choice field with Allow 'Fill-in' choices: Yes" is rendered in Plumsail as a "choice field with Allow 'Fill-in' choices: No".
Is this possible?
Is it possible to prevent users from entering their own value in the choice field, even though the option "Allow 'Fill-in' choices" is enabled?
any help is appreciated,
kind regards,
bartplessers