Option set | Save in DB

Hello,
Hope you had a nice Christmas time, maybe you can help with this :slight_smile:

  1. I created an input form in a form. This input form is linked to an option set (ex. When the price variation is of 0, then it displays "price is stable’ extracted from an option set)

  1. The result of the input form is correct and I would like it to be stored in DB

  2. The DB field (13_Contract_reason) is based on the same option set used at step 1 BUT it seems that I cannot save it ? any idea why ?

Many thanks to all and wishing you a merry Christmas and a happy new year !

What’s your contract_reason’s data type?

Contract_reason data type is an option set
(also called contract_reason)

What does the issue checker (the red number at the top of the editor) say the issue is?

You’re trying to set 13_Contract_Reason to text (for example, Avenant prix constant’s Display is a text type) when 13_Contract_Reason wants an option.

Indeed, I’m trying to directly feed the database with text corresponding to the value of the option set using an input form. In this case the result is mecanical (if the price is X, the value of the option is Y with an X depending on the values of in the form)

Error is : Value should be Contract_reason but now this is a text

Any idea how to feed the database with the option set using a text field ?

I’m not sure what you are asking here. You have a type mismatch… simple as that. You can’t save a text value to a field that is tied to an option set. I guess you could use the Get an option operator to get the option from the set where the display matches the text, but again, I’m not sure what you are trying to do here.

1 Like

Initially, I was willing to use an option set in the « Contract_reason » field because it restricts the possibilities (here : new contact, endorsement with tarif increase, endorsement with tarif decrease)

In the form, I have data (here : value of new contract and value of old contract) that triggers the option set value (here : if new value > old value then it an “endorsement with tarif increase” - done via conditions)

Process works excepts that the value is a text and seems that it cannot feed the DB so I’m looking for an alternative option to feed the DB (of course I can use a “text” field in DB but seems less elegant)

Thanks !

I still don’t get it, but I will respond one more time. If you are asking if you can save a value in a field that is tied to an option set by using a text value to get the correct option, the answer is yes, and it would look something like this.

Note that the zodiac field is tied to an option set, and the input | zodiac sign input element has a content format of text.

[quote=“mikeloc, post:11, topic:238756”]
:grinning: Many thanks, you solved it ! so easily … many thanks !!!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.