how to set a fields value to equal another fields value in infopath Form?
-
19-12-2020 - |
Question
I'm setting up a calculated field and I need to display a value from another field based on another field's entry. Example:
If EventType equals "Down Time", set calculated field value to equal the value in the EventTime field.
If EventType equals "Slow Time", set calculated field to default formula.
How on earth do I do this?
La solution
In InfoPath, you should be aware of you can't set the calculated field
directly through the rule. and to achieve that as a workaround, you should do the following:
- Add a new text field to your form > rename it as you need (
field1
). - In calculated field > specify its data source to be this field
field1
by right click > select properties > specify the data source. - Now click on your
EventType
field > from the above ribbon > properties tab > add a ruleon This Field Change
>Set A field Value
.
- At set Field value, select the field that you have already inserted (
field1
). - At the Value > click on function column > select
EventTime
field as shown below.
- Now the value of
field1
should be the value ofEventTime
when theEventType
is changed. Meanwhile, thecalculated field
data source isfield1
.so thecalculated field
=field1
. - the last thing, to make
field1
hidden, just remove it from form, but it will be there in fields list at Main data connection.
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange