Values saved by Flow using Picklist Choices saving Translated values for Picklist field in Database
Last updated 2017-04-14 ·Reference W-3217898 ·Reported By 3 users
Summary
With translation enabled, Flow’s record create is saving the translated value of the picklist choice in the database, instead of the original value.
If the same record is created from UI, despite the translated value being shown in UI while creating the record, the original value is stored in database.
For example, if the translation is enabled such that the string “default” is translated to string “translated” in the Translation Workbench.
Consider the following :
- A custom object with a custom picklist field with values {value1_default, value2_default, value3_default}
- A flow with an input screen (with necessary inputs fields for that custom object including a choice element backed by the custom picklist), followed by a Record Create using the inputs from the first flow input screen.
Actual Result:
- During flow execution, the picklist choices are shown as {value1_translated, value2_ translated, value3_translated} in the flow input screen. If the user selects value1_translated, the custom object record gets created and has picklist choice saved as as "value1_translated" in the database. This can be confirmed by SOQL query via workbench or Developer Console.
Expected Result:
- Original value (value1_default) needs to be stored in database for the picklist field which happens when the record is saved using the UI. This can also be confirmed by SOQL Query via Workbench or Developer Console.
Repro
In a fresh org :
* Create custom object with one custom picklist field :
=========================================
- Go to setup page and search for “objects” in the quick find box and choose “Objects” under “Create”
- Click “New Custom Object” and enter the following details :
# Label: MyCustomObjectWithCustomPickList
# Plural Label: MyCustomObjectsWithCustomPickList
# Check “Launch New Custom Tab Wizard after saving this custom object”
# Click "Save".
- Choose your favorite “Tab style”
- Click "Next".
- Click "Save"
- Now, on the “MyCustomObjectWithCustomPickList” page, under “Custom Fields & Relationships”, click “New”
- Select Picklist and click "Next".
- Enter the following information :
#Field Label: MyCustomPickList
- Select “Enter values for the picklist, with each value separated by a new line.”
- Enter the following values in the text area one per line:
#value1_default
#value2_default
#value3_default
- Uncheck “Strictly enforce picklist values”
- click "Next" and then "Save".
* Enable and setup translation :
=========================
- Go to setup page and search for “translation” in the quick find box and select “Translation Settings”
- Click “Enable”
- Now click “Add” button in the same page.
- Move your user id from “Available List” to “Selected List”
- Click “Translate” under “Translation workbench” on the left tree
- Select filter criteria :
# Language: English
# Setup Component: PickList Value
# Object: MyCustomObjectWithCustomPickList
# Expand the “MyCustomPickList” under Master PickList Value Label
# Enter the following picklist value translation values: value1_translated, value2_translated, value3_translated
# Click "Save".
* Create and run flows :
===================
- Go to setup page and search for “Flows” in the quick find box and select Flows under workflows.
- Click “New flow” to open the flow designer.
- Drag and drop a “Screen” from the palette.
- General Info - Name: Input Screen
- Add a Field – drag and drop a text box from inputs
- Select the text box to go to Field Settings – Label: “MyCustomObjectWithCustomPickList Name”
- Add a Field – drag and drop a Dropdown List from choices
- Select the dropdown list to goto field settings – Label: “MyCustomPickList”
- Choice: Create new Picklist choice.
- In picklist choice window :
# Unique name: MyCustomPickListValues
# Object: Custom:: MyCustomObjectWithCustomPickList__c
# Field: Custom:: MyCustomPickList__c
- Drag and drop “Record create” from the palette :
# Name: CreateMyCustomObjectWithCustomPickList
- Assignments:
# Create: custom::MyCustomObjectWithCustomPickList__c
# Field: standard::name – value:Screen input fields:: MyCustomObjectWithCustomPickList_Name
# Click "Add row".
# Field: custom:: MyCustomPickList__c – value:screen choice fields: MyCustomPickList
- click "OK".
- Now connect the flow from screen input to record create and set the input screen as starting element.
- click "Save".
# Name: MyCustomFlow
# Type: Flow
# Now click Run to got the newly launched flow screen called “MyCustomFlow”
# MyCustomObjectWithCustomPickList Name : MyCustomObjectWithCustomPickList1_Flow
# MyCustomPickList: value1_translated
# click "Next"
- The flow screen creates a new custom object and reloads.
* Testing the Picklist Values saved in the record :
======================================
- Get the ID of MyCustomObjectWithCustomPickList1_Flow from UI.
- Execute the following SOQL query
SELECT name, MyCustomPickList__c FROM MyCustomObjectWithCustomPickList__c where id='a01xx0000005mSz' [Where Id a01xx0000005mSz is the ID of the record created by Flow]
Actual Result: :
# Name : MyCustomPickList__c
# MyCustomObjectWithCustomPickList1_Flow : value1_translated
Expected Result:
# Name : MyCustomPickList__c
# MyCustomObjectWithCustomPickList1_Flow : value1_default
Workaround
N/A
Reported By (3)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.