Show name instead of sys_id in string field populated by variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2016 12:48 AM
Hi,
I have a variable which is referencing a list of data in a bespoke table (x_yobs_regulatory_regulatory_breach_tier_1)
The variable is tier_1
I want the name of the data entry to appear in a mapped string field on the associated table instead of it's sys_id. The field needs to be string for another purpose so this cannot be changed.
Currently when the form is submitted it show the sys_id as below but I need it show show the label/name
How can i achieve this?
Thanks in advance.
Emma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2016 01:00 AM
if your setting this field via script you should be able to dot walk to the name:
current.variables.tier_1.name (or u_name)
alternatively, you could make the variable a 'lookup select' type variable, similar to reference but changes it to a dropdown, but then you can specify which field from the lookup table to store the value of, i.e. name so no scripting required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2016 01:05 AM
Hi, thanks for your reply.
Can you expand on the first suggestion please?
I'm not able to use lookup select box as the the fields are dependent and the data doesn't transfer through correctly.
Thanks,
Emma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2016 01:08 AM
understood, in which case we can use a script to grab the name from the reference variable in the producer, before we transfer it to a real record and lose the reference field.
in your producer script you should be able to do this instead of mapping the 2 fields
current.fieldname(your string field) = producer.tier_1.name;
try that and see if it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2016 01:22 AM